//v.2.5 build 91111
/*
===================================================================
Copyright DHTMLX LTD. http://www.dhtmlx.com
This code is obfuscated and not allowed for any purposes except 
using on sites which belongs to DHTMLX LTD.

Please contact sales@dhtmlx.com to obtain necessary 
license for usage of dhtmlx components.
===================================================================
*/
function xmlPointer(data) {
    this.d = data
};
xmlPointer.prototype = {
    text: function() {
        if (!aq) return this.d.xml;
        var x = new XMLSerializer();
        return x.serializeToString(this.d)
    },
    get: function(name) {
        return this.d.getAttribute(name)
    },
    exists: function() {
        return ! !this.d
    },
    content: function() {
        return this.d.firstChild ? this.d.firstChild.data: ""
    },
    Kw: function(name, f, t, i) {
        var a = this.d.childNodes;
        var c = new xmlPointer();
        if (a.length) for (i = i || 0; i < a.length; i++) if (a[i].tagName == name) {
            c.d = a[i];
            if (f.apply(t, [c, i]) == -1) return
        }
    },
    Zn: function() {
        var a = {};
        var b = this.d.attributes;
        for (var i = 0; i < b.length; i++) a[b[i].name] = b[i].value;
        return a
    },
    sub: function(name) {
        var a = this.d.childNodes;
        var c = new xmlPointer();
        if (a.length) for (var i = 0; i < a.length; i++) if (a[i].tagName == name) {
            c.d = a[i];
            return c
        }
    },
    up: function(name) {
        return new xmlPointer(this.d.parentNode)
    },
    set: function(name, val) {
        this.d.setAttribute(name, val)
    },
    QF: function(name) {
        return new xmlPointer(this.d)
    },
    tX: function(name) {
        var a = this.d.childNodes;
        if (a.length) for (var i = 0; i < a.length; i++) if (a[i].tagName == name) return true;
        return false
    },
    through: function(name, rule, v, f, t) {
        var a = this.d.childNodes;
        if (a.length) for (var i = 0; i < a.length; i++) {
            if (a[i].tagName == name && a[i].getAttribute(rule) != null && a[i].getAttribute(rule) != "" && (!v || a[i].getAttribute(rule) == v)) {
                var c = new xmlPointer(a[i]);
                f.apply(t, [c, i])
            };
            var w = this.d;
            this.d = a[i];
            this.through(name, rule, v, f, t);
            this.d = w
        }
    }
};

/**
*     @desc: tree constructor
*     @param: htmlObject - parent html object or id of parent html object
*     @param: width - tree width
*     @param: height - tree height
*     @param: rootId - id of virtual root node (same as tree node id attribute in xml)
*     @type: public
*     @topic: 0
*/
function dhtmlXTreeObject(aI, width, height, fO) {
    if (_isIE) try {
        document.execCommand("BackgroundImageCache", false, true)
    } catch(e) {};
    if (typeof(aI) != "object") this.parentObject = document.getElementById(aI);
    else this.parentObject = aI;
    this.parentObject.style.overflow = "hidden";
    this.Xy = true;
    this.jB = ",";
    this.aep = false;
    this.enableIEImageFix();
    this.ku = 0;
    this.acE = "tree";
    this.xL = true;
    this.width = width;
    this.height = height;
    this.fO = fO;
    this.fo = null;
    this.ST = "18px";
    this.SR = "18px";
    this.Rr = "18px";
    this.QQ = "18px";
    this.jG = new Array();
    this._selected = new Array();
    this.Id = "pointer";
    if (_isIE) this.Id = "hand";
    this.Jm = true;
    this.sP = " [";
    this.htmlcB = "]";
    this.Rs = window;
    this.Hb = 0;
    this.Li = 0;
    this.iconURL = "";
    this.mj = 0;
    this.Es = false;
    this.PZ = true;
    this.acX = 0;
    this.rN = new Array();
    this.fs = 0;
    this.ek = 0;
    this.gQ = {};
    this.SV = 0;
    this.Fc = true;
    this.tO = false;
    this.We = true;
    this.BM = false;
    this.xA = null;
    this.HM = [];
    this.mF = window.fe || "";
    this.Bq = new Array("iconUncheckAll.gif", "iconCheckAll.gif", "iconCheckGray.gif", "iconUncheckDis.gif", "iconCheckDis.gif", "iconCheckDis.gif");
    this.GR = new Array("radio_off.gif", "radio_on.gif", "radio_on.gif", "radio_off.gif", "radio_on.gif", "radio_on.gif");
    this.wf = new Array("line2.gif", "line3.gif", "line4.gif", "blank.gif", "blank.gif", "line1.gif");
    this.mQ = new Array("minus2.gif", "minus3.gif", "minus4.gif", "minus.gif", "minus5.gif");
    this.nj = new Array("plus2.gif", "plus3.gif", "plus4.gif", "plus.gif", "plus5.gif");
    this.gZ = new Array("leaf.gif", "folderOpen.gif", "folderClosed.gif");
    this.ary = new Array(0, 0, 0);
    this.agE = "but_cut.gif";
    dhtmlxEventable(this);
    this.M = new J();
    this.ao = new dhtmlXTreeItemObject(this.fO, "", 0, this);
    this.ao.ao.childNodes[0].childNodes[0].style.display = "none";
    this.ao.ao.childNodes[0].childNodes[0].childNodes[0].className = "hiddenRow";
    this.cB = this.na();
    this.cB.appendChild(this.ao.ao);
    if (aq) {
        this.cB.childNodes[0].width = "100%";
        this.cB.childNodes[0].style.overflow = "hidden"
    };
    var self = this;
    this.cB.onselectstart = new Function("return false;");
    if (gP) this.cB.oncontextmenu = function(e) {
        return self._doContClick(e || window.event)
    };
    this.cB.onmousedown = function(e) {
        return self._doContClick(e || window.event)
    };
    this.dF = new ag(this.hf, this, true, this.ir);
    if (_isIE) this.jJ(true);
    this.selectionBar = document.createElement("DIV");
    this.selectionBar.className = "selectionBar";
    this.selectionBar.innerHTML = "&nbsp;";
    this.selectionBar.style.display = "none";
    this.cB.appendChild(this.selectionBar);
    if (window.addEventListener) window.addEventListener("unload",
    function() {
        try {
            self.destructor()
        } catch(e) {}
    },
    false);
    if (window.attachEvent) window.attachEvent("onunload",
    function() {
        try {
            self.destructor()
        } catch(e) {}
    });
    this.setImagesPath = this.setImagePath;
    this.setIconsPath = this.setIconPath;
    if (dhtmlx.image_path) this.setImagePath(dhtmlx.image_path);
    if (dhtmlx.skin) this.setSkin(dhtmlx.skin);
    return this
};
dhtmlXTreeObject.prototype.setDataMode = function(mode) {
    this.Kl = mode
};
dhtmlXTreeObject.prototype._doContClick = function(ev) {
    if (ev.button != 2) {
        if (this.Lt) {
            if (this.Lt.hideContextMenu) this.Lt.hideContextMenu();
            else this.Hb.ES()
        };
        return true
    };
    var el = (_isIE ? ev.srcElement: ev.target);
    while ((el) && (el.tagName != "BODY")) {
        if (el.parentObject) break;
        el = el.parentNode
    };
    if ((!el) || (!el.parentObject)) return true;
    var obj = el.parentObject;
    if (!this.callEvent("onRightClick", [obj.id, ev]))(ev.srcElement || ev.target).oncontextmenu = function(e) { (e || event).cancelBubble = true;
        return false
    };
    this.Lt = (obj.Hb || this.Hb);
    if (this.Lt) {
        if (! (this.callEvent("onBeforeContextMenu", [obj.id]))) return true; (ev.srcElement || ev.target).oncontextmenu = function(e) { (e || event).cancelBubble = true;
            return false
        };
        if (this.Lt.showContextMenu) {
            this.Lt.showContextMenu(ev.clientX - 1, ev.clientY - 1);
            this.contextID = obj.id;
            ev.cancelBubble = true;
            this.Lt._skip_hide = true
        } else {
            el.contextMenuId = obj.id;
            el.contextMenu = this.Lt;
            el.a = this.Lt.vm;
            el.a(el, ev);
            el.a = null
        };
        return false
    };
    return true
};
dhtmlXTreeObject.prototype.enableIEImageFix = function(mode) {
    if (!mode) {
        this.Lg = function(id) {
            return document.createElement((id == this.fO) ? "div": "img")
        };
        this.Rx = function(a, b) {
            a.src = b
        };
        this.YW = function(a) {
            return a.src
        }
    } else {
        this.Lg = function() {
            var z = document.createElement("DIV");
            z.innerHTML = "&nbsp;";
            z.className = "dhx_bg_img_fix";
            return z
        };
        this.Rx = function(a, b) {
            a.style.backgroundImage = "url(" + b + ")"
        };
        this.YW = function(a) {
            var z = a.style.backgroundImage;
            return z.substr(4, z.length - 5)
        }
    }
};
dhtmlXTreeObject.prototype.destructor = function() {
    for (var a in this.gQ) {
        var z = this.gQ[a];
        if (!z) continue;
        z.parentObject = null;
        z.treeNod = null;
        z.childNodes = null;
        z.span = null;
        z.tr.mX = null;
        z.tr = null;
        z.ao.Jh = null;
        z.ao = null;
        this.gQ[a] = null
    };
    this.parentObject.innerHTML = "";
    if (this.dF) this.dF.destructor();
    this.cB.onselectstart = null;
    this.cB.oncontextmenu = null;
    this.cB.onmousedown = null;
    for (var a in this) {
        this[a] = null
    }
};
function Fn() {
    return this
};
Fn.prototype = new Object;
Fn.prototype.QF = function() {
    function adK() {};
    adK.prototype = this;
    return new adK()
};
function dhtmlXTreeItemObject(itemId, itemText, parentObject, bG, eP, mode) {
    this.ao = "";
    this.kP = "";
    this.mB = "";
    this.tr = 0;
    this.aE = 0;
    this.dH = 0;
    this.dG = 0;
    this.fj = 0;
    this.MP = 0;
    this.span = 0;
    this.ro = 1;
    this.childNodes = new Array();
    this.userData = new Fn();
    this.cY = 0;
    this.treeNod = bG;
    this.label = itemText;
    this.parentObject = parentObject;
    this.eP = eP;
    this.images = new Array(bG.gZ[0], bG.gZ[1], bG.gZ[2]);
    this.id = bG.oh(itemId, this);
    if (this.treeNod.ps) this.ao = this.treeNod.ux(1, this, mode);
    else this.ao = this.treeNod.ux(0, this, mode);
    this.ao.Jh = this;
    return this
};
dhtmlXTreeObject.prototype.oh = function(itemId, aa) {
    if (this.ak(itemId, 1, 1)) {
        itemId = itemId + "_" + (new Date()).valueOf();
        return this.oh(itemId, aa)
    };
    this.gQ[itemId] = aa;
    this.SV++;
    return itemId
};
dhtmlXTreeObject.prototype.rW = function(itemId) {
    if (this.gQ[itemId]) {
        this.rH(this.gQ[itemId]);
        this.gQ[itemId] = null;
        this.SV--
    };
    if ((this.nG) && (this.nG[itemId])) this.nG[itemId] = false
};
dhtmlXTreeObject.prototype.ak = function(itemId, AE, pd, acV) {
    var z = this.gQ[itemId];
    if (z) {
        if ((z.bZ) && (!pd)) {
            this.tK(z, 0)
        };
        if (this.ahK && !z.ao) this.aaQ(z, pd);
        if ((acV) && (this.hv)) {
            for (var j = 0; j < this.hv.length; j++) if (this.hv[j][2] == itemId) {
                ey.gn("getItem", "Requested item still in parsing process.", itemId);
                return null
            }
        };
        return z
    };
    if ((this.Es) && (itemId != 0) && (!AE)) return this.afN(itemId);
    else return null
};
dhtmlXTreeObject.prototype.Qo = function(p) {
    var z = [];
    p.Kw("item",
    function(c) {
        z.push(c.get("id"))
    },
    this);
    return z.join(",")
};
dhtmlXTreeObject.prototype.enableSmartXMLParsing = function(mode) {
    this.Es = K(mode)
};
dhtmlXTreeObject.prototype.aqs = function(node, asv, val) {};
dhtmlXTreeObject.prototype.LU = function(p, list, mode) {
    var z = [];
    if (mode == 2) p.through("item", "checked", mode,
    function(c) {
        z.push(c.get("id"))
    },
    this);
    if (mode == 1) p.through("item", "id", null,
    function(c) {
        if (c.get("checked") && (c.get("checked") != -1)) z.push(c.get("id"))
    },
    this);
    if (mode == 0) p.through("item", "id", null,
    function(c) {
        if (!c.get("checked") || c.get("checked") == 0) z.push(c.get("id"))
    },
    this);
    return list + (list ? ",": "") + z.join(",");
    if (list) return list;
    else return ""
};
dhtmlXTreeObject.prototype.LT = function(state, p) {
    var val = state ? "1": "";
    p.through("item", "id", null,
    function(c) {
        c.set("checked", val)
    },
    this)
};
dhtmlXTreeObject.prototype.uD = function(p, x) {
    var z = [];
    var aeB = function(c) {
        if (!c.tX("item")) z.push(c.get("id"));
        else c.Kw("item", aeB, this)
    };
    aeB(p);
    return z.join(",")
};
dhtmlXTreeObject.prototype.zW = function(p, x) {
    var z = [];
    var aeB = function(c) {
        if (!c.tX("item")) return;
        z.push(c.get("id"));
        c.Kw("item", aeB, this)
    };
    aeB(p);
    return z.join(",")
};
dhtmlXTreeObject.prototype.Ku = function(itemId, z, p) {
    var z = [];
    p.through("item", "id", null,
    function(c) {
        z.push(c.get("id"))
    },
    this);
    return z.join(",")
};
dhtmlXTreeObject.prototype.tK = function(node) {
    var that = this;
    if (!this.lQ) that.callEvent("onXLS", [that, node.id]);
    this.ku = 1;
    var YV = node.bZ;
    node.bZ = 0;
    this.ek = 1;
    var ame = this.tw;
    var anH = this.hL;
    var anM = this.jy;
    this.jy = new Array();
    this.hL = false;
    this.tw = node.id;
    this.jy = new Array();
    this.sK = "";
    this.Aq(YV, node.id, 2);
    var wG = this.sK.split(this.jB);
    for (var i = 0; i < this.jy.length; i++) node.ao.childNodes[0].appendChild(this.jy[i]);
    if (YV.get("order") && YV.get("order") != "none") this.tM(node, YV.get("order"), true);
    this.abn = this.xL;
    this.xL = false;
    for (var n = 0; n < wG.length; n++) if (wG[n]) this.setCheck(wG[n], 1);
    this.xL = this.abn;
    this.tw = ame;
    this.hL = anH;
    this.jy = anM;
    this.ek = 0;
    this.jm(this, node);
    if (this.ahK && !node.Rb) this.zz(node.id);
    this.ku = 0;
    return true
};
dhtmlXTreeObject.prototype.afN = function(itemId) {
    if (!itemId || !this.Pv) return null;
    var result = false;
    this.Pv.QF().through("item", "id", itemId,
    function(c) {
        this.ak(c.up().get("id"));
        return result = true
    },
    this);
    if (result) {
        var n = this.ak(itemId, true, false);
        if (!n) ey.gn("getItem", "The item " + itemId + " not operable. Seems you have non-unique|incorrect IDs in tree's XML.", itemId)
    };
    return n
};
dhtmlXTreeObject.prototype.xZ = function(str) {
    switch (this.aeh) {
    case "none":
        return str;
        break;
    case "utf8":
        return encodeURIComponent(str);
        break;
    default:
        return escape(str);
        break
    }
};
dhtmlXTreeObject.prototype.YT = function(aI, node) {
    var tr = document.createElement('tr');
    var xp = document.createElement('td');
    var Bb = document.createElement('td');
    xp.appendChild(document.createTextNode(" "));
    Bb.colSpan = 3;
    Bb.appendChild(aI);
    tr.appendChild(xp);
    tr.appendChild(Bb);
    return tr
};
dhtmlXTreeObject.prototype.loadXMLString = function(RA, bo) {
    var that = this;
    if (!this.lQ) this.callEvent("onXLS", [that, null]);
    this.ku = 1;
    if (bo) this.dF.bs = bo;
    this.dF.loadXMLString(RA)
};
dhtmlXTreeObject.prototype.loadXML = function(file, bo) {
    if (this.Kl && this.Kl != "xml") return this["load" + this.Kl.toUpperCase()](file, bo);
    var that = this;
    if (!this.lQ) this.callEvent("onXLS", [that, this.xA]);
    this.xA = null;
    this.ku = 1;
    this.dF = new ag(this.hf, this, true, this.ir);
    if (bo) this.dF.bs = bo;
    this.dF.loadXML(file)
};
dhtmlXTreeObject.prototype.kV = function(parentObject, itemId, itemText, kA, kQ, kS, nI, kC, bu, bT, JU) {
    if (bT && bT.parentObject) parentObject = bT.parentObject;
    if (((parentObject.fS == 0) && (this.fs)) && (!this.ek)) {
        parentObject.fS = 1;
        this.pA(parentObject.id)
    };
    var Count = parentObject.aE;
    var dN = parentObject.childNodes;
    if (JU) {
        if (JU.tr.previousSibling.previousSibling) {
            bT = JU.tr.previousSibling.mX
        } else kC = kC.replace("TOP", "") + ",TOP"
    };
    if (bT) {
        var ik, jk;
        for (ik = 0; ik < Count; ik++) if (dN[ik] == bT) {
            for (jk = Count; jk != ik; jk--) dN[1 + jk] = dN[jk];
            break
        };
        ik++;
        Count = ik
    };
    if (kC) {
        var FZ = kC.split(",");
        for (var i = 0; i < FZ.length; i++) {
            switch (FZ[i]) {
            case "TOP":
                if (parentObject.aE > 0) {
                    bT = new Object;
                    bT.tr = parentObject.childNodes[0].tr.previousSibling
                };
                parentObject.agc = true;
                for (ik = Count; ik > 0; ik--) dN[ik] = dN[ik - 1];
                Count = 0;
                break
            }
        }
    };
    var n;
    if (! (n = this.gQ[itemId]) || n.span != -1) {
        n = dN[Count] = new dhtmlXTreeItemObject(itemId, itemText, parentObject, this, kA, 1);
        itemId = dN[Count].id;
        parentObject.aE++
    };
    if (!n.ao) {
        n.label = itemText;
        n.ao = this.ux((this.ps ? 1 : 0), n);
        n.ao.Jh = n
    };
    if (kQ) n.images[0] = kQ;
    if (kS) n.images[1] = kS;
    if (nI) n.images[2] = nI;
    var tr = this.YT(n.ao);
    if ((this.ek) || (this.agX)) n.ao.parentNode.parentNode.style.display = "none";
    if ((bT) && (bT.tr.nextSibling)) parentObject.ao.childNodes[0].insertBefore(tr, bT.tr.nextSibling);
    else if (this.tw == parentObject.id) {
        this.jy[this.jy.length] = tr
    } else parentObject.ao.childNodes[0].appendChild(tr);
    if ((bT) && (!bT.span)) bT = null;
    if (this.fs) if ((bu) && (bu != 0)) n.fS = 0;
    else n.fS = 1;
    n.tr = tr;
    tr.mX = n;
    if (parentObject.itemId == 0) tr.childNodes[0].className = "hiddenRow";
    if ((parentObject.nN) || (this.Co)) this.Rx(n.ao.childNodes[0].childNodes[0].childNodes[1].childNodes[0], this.mF + this.GR[0]);
    if (kC) {
        var FZ = kC.split(",");
        for (var i = 0; i < FZ.length; i++) {
            switch (FZ[i]) {
            case "SELECT":
                this.selectItem(itemId, false);
                break;
            case "CALL":
                this.selectItem(itemId, true);
                break;
            case "CHILD":
                n.fS = 0;
                break;
            case "CHECKED":
                if (this.ek) this.sK += this.jB + itemId;
                else this.setCheck(itemId, 1);
                break;
            case "HCHECKED":
                this.bL(n, "unsure");
                break;
            case "OPEN":
                n.Xm = 1;
                break
            }
        }
    };
    if (!this.ek) {
        if ((this.dD(parentObject) < 0) && (!this.agX)) this.openItem(parentObject.id);
        if (bT) {
            this.cE(bT);
            this.gK(bT)
        };
        this.cE(parentObject);
        this.gK(parentObject);
        this.cE(n);
        if (parentObject.aE >= 2) {
            this.cE(dN[parentObject.aE - 2]);
            this.gK(dN[parentObject.aE - 2])
        };
        if (parentObject.aE != 2) this.cE(dN[0]);
        if (this.tO) this.gU(parentObject);
        if (this.BX) {
            if (this.ku == 1) {
                var old = this.onXLE;
                this.onXLE = function(id) {
                    this.BX(itemId);
                    if (old) old(id)
                }
            } else this.BX(itemId)
        }
    };
    return n
};
dhtmlXTreeObject.prototype.enableContextMenu = function(menu) {
    if (menu) this.Hb = menu
};
dhtmlXTreeObject.prototype.adc = function(itemId, Hb) {
    var l = itemId.toString().split(this.jB);
    for (var i = 0; i < l.length; i++) {
        var AT = this.ak(l[i]);
        if (!AT) continue;
        AT.Hb = Hb
    }
};
dhtmlXTreeObject.prototype.insertNewItem = function(parentId, itemId, itemText, kA, kQ, kS, nI, kC, children) {
    var parentObject = this.ak(parentId);
    if (!parentObject) return ( - 1);
    var aaN = this.kV(parentObject, itemId, itemText, kA, kQ, kS, nI, kC, children);
    if ((!this.ek) && (this.fo)) this.fH(parentObject);
    return aaN
};
dhtmlXTreeObject.prototype.insertNewChild = function(parentId, itemId, itemText, kA, kQ, kS, nI, kC, children) {
    return this.insertNewItem(parentId, itemId, itemText, kA, kQ, kS, nI, kC, children)
};
dhtmlXTreeObject.prototype.hf = function(a, b, c, d, xml) {
    var p = new xmlPointer(xml.cR("tree"));
    a.Aq(p);
    a.Pv = p
};
dhtmlXTreeObject.prototype.OU = function(c, AT, yc, ajw) {
    var id;
    if (this.ahK && (!this.gQ[id = c.get("id")] || !this.gQ[id].span)) {
        this.WE(AT.id, id, c);
        return
    };
    var a = c.Zn();
    if ((typeof(this.hL) == "object") && (!this.hL[a.id])) {
        this.Aq(c, a.id, 1);
        return
    };
    if ((a.text === null) || (typeof(a.text) == "undefined")) {
        a.text = c.sub("itemtext");
        if (a.text) a.text = a.text.content()
    };
    var Tj = [];
    if (a.select) Tj.push("SELECT");
    if (a.top) Tj.push("TOP");
    if (a.call) this.qf = a.id;
    if (a.checked == -1) Tj.push("HCHECKED");
    else if (a.checked) Tj.push("CHECKED");
    if (a.open) Tj.push("OPEN");
    if (this.hL) {
        if (this.ak(a.id)) var fi = this.aak(a.id, a.text, a.im0, a.im1, a.im2, a.checked);
        else {
            if (this.Za == 0) Tj.push("TOP");
            else yc = AT.childNodes[this.Za];
            var fi = this.kV(AT, a.id, a.text, 0, a.im0, a.im1, a.im2, Tj.join(","), a.child, 0, yc);
            yc = null
        }
    } else var fi = this.kV(AT, a.id, a.text, 0, a.im0, a.im1, a.im2, Tj.join(","), a.child, (ajw || 0), yc);
    if (a.tooltip) fi.span.parentNode.parentNode.title = a.tooltip;
    if (a.style) if (fi.span.style.cssText) fi.span.style.cssText += (";" + a.style);
    else fi.span.setAttribute("style", fi.span.getAttribute("style") + ";" + a.style);
    if (a.radio) fi.nN = true;
    if (a.BC) {
        var check_node = fi.span.parentNode.previousSibling.previousSibling;
        check_node.childNodes[0].style.display = 'none';
        if (window._KHTMLrv) check_node.style.display = "none";
        fi.BC = true
    };
    if (a.disabled) {
        if (a.checked != null) this.bL(fi, a.checked);
        this.disableCheckbox(fi, 1)
    };
    fi.ph = a.child || 0;
    if (this.DW) this.DW.ahh.call(this, c, a, (AT ? AT.id: 0));
    this.setItemColor(fi, a.aCol, a.sCol);
    if (a.locked == "1") this.GY(fi.id, true, true);
    if ((a.ajJ) || (a.afH)) this.yZ(a.ajJ, a.afH, fi);
    if ((a.closeable == "0") || (a.closeable == "1")) this.Cq(fi, a.closeable);
    var acb = "";
    if (a.aez) this.setItemTopOffset(fi, a.aez);
    if ((!this.Es) || (typeof(this.hL) == "object")) {
        if (c.tX("item")) acb = this.Aq(c, a.id, 1)
    } else {
        if ((!fi.aE) && c.tX("item")) fi.bZ = c.QF();
        c.Kw("userdata",
        function(u) {
            this.setUserData(a.id, u.get("name"), u.content())
        },
        this)
    };
    if (acb != "") this.qf = acb;
    c.Kw("userdata",
    function(u) {
        this.setUserData(c.get("id"), u.get("name"), u.content())
    },
    this)
};
dhtmlXTreeObject.prototype.Aq = function(p, parentId, gR, start) {
    if (this.ahK && !this.parentObject.offsetHeight) {
        var self = this;
        return window.setTimeout(function() {
            self.Aq(p, parentId, gR, start)
        },
        100)
    };
    if (!p.exists()) return;
    this.Xf = true;
    if (!parentId) {
        parentId = p.get("id");
        if (p.get("radio")) this.ao.nN = true;
        this.tw = parentId;
        this.jy = new Array();
        this.sK = "";
        this.qf = ""
    };
    var AT = this.ak(parentId);
    if (!AT) return ey.gn("DataStructure", "XML refers to not existing parent");
    this.lQ = this.lQ ? (this.lQ + 1) : 1;
    this.ek = 1;
    if ((AT.aE) && (!start) && (!this.Lz) && (!AT.agc)) var yc = AT.childNodes[AT.aE - 1];
    else var yc = 0;
    this.Za = 0;
    p.Kw("item",
    function(c, i) {
        AT.fS = 1;
        if ((this.adO) && (this.Lo == this.Za)) {
            this.Od(AT, this.Za + 1 * (start || 0), gR, node);
            return - 1
        };
        this.OU(c, AT, yc);
        if ((this.Lz) && (this.Za == this.afa)) {
            this.LH(p, i + 1, parentId, gR, AT.aE);
            return - 1
        };
        this.Za++
    },
    this, start);
    if (!gR) {
        p.Kw("userdata",
        function(u) {
            this.setUserData(p.get("id"), u.get("name"), u.content())
        },
        this);
        AT.fS = 1;
        if (this.hL) {
            this.hL = false;
            for (var i = AT.aE - 1; i >= 0; i--) if (AT.childNodes[i].acD) this.deleteItem(AT.childNodes[i].id)
        };
        var aka = this.ak(this.tw);
        for (var i = 0; i < this.jy.length; i++) AT.ao.childNodes[0].appendChild(this.jy[i]);
        this.wK = parentId;
        this.ek = 0;
        var wG = this.sK.split(this.jB);
        for (var n = 0; n < wG.length; n++) if (wG[n]) this.setCheck(wG[n], 1);
        if ((this.fs) && (this.tO) && (this.xL) && (AT.id != this.fO)) {
            if (AT.cY === 0) this.iE(0, AT);
            else if (AT.cY === 1) this.iE(1, AT)
        };
        this.jm(this, null, start);
        if (p.get("order") && p.get("order") != "none") this.tM(AT, p.get("order"), true);
        if (this.qf != "") this.callEvent("onClick", [this.qf, this.getSelectedItemId()]);
        if (this.ve) this.Yt(p)
    };
    if (this.lQ == 1) {
        this.tw = null;
        if (this.ahK && AT.id != this.fO) {
            this.zz(AT.id);
            if (this.fs) this.openItem(AT.id)
        };
        p.through("item", "open", null,
        function(c) {
            this.openItem(c.get("id"))
        },
        this);
        if ((!this.Lz) || (!this.hv.length)) {
            var that = this;
            window.setTimeout(function() {
                that.callEvent("onXLE", [that, parentId])
            },
            1);
            this.ku = 0
        };
        this.Xf = false
    };
    this.lQ--;
    var that = this;
    if (this.Lz) window.setTimeout(function() {
        that.NX(parentId)
    },
    this.afv);
    if ((this.adO) && (start)) this.Og(AT, (start || 0), gR, node);
    if (!gR && this.onXLE) this.onXLE(this, parentId);
    return this.qf
};
dhtmlXTreeObject.prototype.Yt = function(p) {
    p.Kw("item",
    function(c) {
        var zX = c.get("id");
        if (this.gQ[zX] && (!this.gQ[zX].fS)) return;
        this.ve++;
        this.smartRefreshItem(c.get("id"), c)
    },
    this);
    this.ve--
};
dhtmlXTreeObject.prototype.akd = function(node, parentId) {
    if ((node.nodeType == 1) && (node.tagName == "userdata")) {
        var name = node.getAttribute("name");
        if ((name) && (node.childNodes[0])) this.setUserData(parentId, name, node.childNodes[0].data)
    }
};
dhtmlXTreeObject.prototype.jm = function(Ll, aa, start, aio) {
    if (!aa) {
        var fE = Ll.ak(Ll.wK);
        Ll.wK = -1;
        if (!fE) return 0
    } else fE = aa;
    var afB = 0;
    for (var i = (start ? start - 1 : 0); i < fE.aE; i++) {
        if ((!this.ve) || (this.dD(fE) == 1)) if ((!aa) || (aio == 1)) fE.childNodes[i].ao.parentNode.parentNode.style.display = "";
        if (fE.childNodes[i].Xm == 1) {
            this.nk(fE.childNodes[i]);
            fE.childNodes[i].Xm = 0
        };
        Ll.jm(Ll, fE.childNodes[i]);
        if (this.fo != null) {
            if ((fE.childNodes[i].bZ) || ((!fE.childNodes[i].fS) && (this.fs))) {
                if (fE.childNodes[i].ph) fE.childNodes[i].span.innerHTML = fE.childNodes[i].label + this.sP + fE.childNodes[i].ph + this.htmlcB;
                else fE.childNodes[i].span.innerHTML = fE.childNodes[i].label
            };
            if ((fE.childNodes[i].childNodes.length) && (this.fo)) {
                if (this.fo == 1) {
                    fE.childNodes[i].span.innerHTML = fE.childNodes[i].label + this.sP + fE.childNodes[i].aE + this.htmlcB
                };
                if (this.fo == 2) {
                    var KH = fE.childNodes[i].aE - (fE.childNodes[i].GW || 0);
                    if (KH) fE.childNodes[i].span.innerHTML = fE.childNodes[i].label + this.sP + KH + this.htmlcB;
                    if (fE.GW) fE.GW++;
                    else fE.GW = 1
                };
                if (this.fo == 3) {
                    fE.childNodes[i].span.innerHTML = fE.childNodes[i].label + this.sP + fE.childNodes[i].ph + this.htmlcB
                };
                if (this.fo == 4) {
                    var KH = fE.childNodes[i].ph;
                    if (KH) fE.childNodes[i].span.innerHTML = fE.childNodes[i].label + this.sP + KH + this.htmlcB
                }
            } else if (this.fo == 4) {
                afB++
            };
            afB += fE.childNodes[i].ph;
            if (this.fo == 3) {
                afB++
            }
        }
    };
    if ((!fE.bZ) && ((fE.fS) || (!this.fs))) fE.ph = afB;
    Ll.gK(fE);
    Ll.cE(fE);
    if ((this.fo) && (!aa)) Ll.fH(fE)
};
dhtmlXTreeObject.prototype.na = function() {
    var div = document.createElement('div');
    div.className = "containerTableStyle";
    div.style.width = this.width;
    div.style.height = this.height;
    this.parentObject.appendChild(div);
    return div
};
dhtmlXTreeObject.prototype.Ho = function(aa) {
    if (aa.bZ) return;
    if (this.fO != aa.id) {
        var dN = aa.ao.childNodes[0].childNodes;
        var Count = dN.length;
        for (var i = 1; i < Count; i++) dN[i].style.display = "none";
        this.cE(aa)
    };
    for (var i = 0; i < aa.aE; i++) if (aa.childNodes[i].aE) this.Ho(aa.childNodes[i])
};
dhtmlXTreeObject.prototype.SP = function(aa) {
    this.kK(aa, 2);
    for (var i = 0; i < aa.aE; i++) this.SP(aa.childNodes[i])
};
dhtmlXTreeObject.prototype.cE = function(aa) {
    if (!aa.ao) return;
    var OE = aa.ao.childNodes[0].childNodes[0].childNodes[0].lastChild;
    var OG = aa.ao.childNodes[0].childNodes[0].childNodes[2].childNodes[0];
    var Ae = this.wf;
    if ((this.fs) && (!aa.fS)) {
        var Ae = this.nj;
        this.Rx(OG, this.iconURL + aa.images[2]);
        if (this.Lu) return (OE.innerHTML = "[+]")
    } else if ((aa.aE) || (aa.bZ)) {
        if ((aa.ao.childNodes[0].childNodes[1]) && (aa.ao.childNodes[0].childNodes[1].style.display != "none")) {
            if (!aa.abd) var Ae = this.mQ;
            this.Rx(OG, this.iconURL + aa.images[1]);
            if (this.Lu) return (OE.innerHTML = "[-]")
        } else {
            if (!aa.abd) var Ae = this.nj;
            this.Rx(OG, this.iconURL + aa.images[2]);
            if (this.Lu) return (OE.innerHTML = "[+]")
        }
    } else {
        this.Rx(OG, this.iconURL + aa.images[0])
    };
    var Zq = 2;
    if (!aa.treeNod.Fc) this.Rx(OE, this.mF + Ae[3]);
    else {
        if (aa.parentObject) Zq = this.Qc(aa.id, aa.parentObject);
        this.Rx(OE, this.mF + Ae[Zq])
    }
};
dhtmlXTreeObject.prototype.gK = function(aa) {
    if (!aa.ao) return;
    var aX = aa.parentObject;
    if (aX) if ((this.Sk(aa.id, aX) == 0) || (!this.Fc)) for (var i = 1; i <= aa.aE; i++) {
        if (!aa.ao.childNodes[0].childNodes[i]) break;
        aa.ao.childNodes[0].childNodes[i].childNodes[0].style.backgroundImage = "";
        aa.ao.childNodes[0].childNodes[i].childNodes[0].style.backgroundRepeat = ""
    } else for (var i = 1; i <= aa.aE; i++) {
        if (!aa.ao.childNodes[0].childNodes[i]) break;
        aa.ao.childNodes[0].childNodes[i].childNodes[0].style.backgroundImage = "url(" + this.mF + this.wf[5] + ")";
        aa.ao.childNodes[0].childNodes[i].childNodes[0].style.backgroundRepeat = "repeat-y"
    }
};
dhtmlXTreeObject.prototype.Qc = function(itemId, aa) {
    if (aa.aE <= 1) {
        if (aa.id == this.fO) return 4;
        else return 0
    };
    if (aa.childNodes[0].id == itemId) if (aa.id == this.fO) return 2;
    else return 1;
    if (aa.childNodes[aa.aE - 1].id == itemId) return 0;
    return 1
};
dhtmlXTreeObject.prototype.Sk = function(itemId, aa) {
    if (aa.childNodes[aa.aE - 1].id == itemId) return 0;
    return 1
};
dhtmlXTreeObject.prototype.kK = function(aa, mode) {
    if ((this.fs) && (!aa.fS)) {
        if (mode == 1) return;
        aa.fS = 1;
        this.pA(aa.id);
        return
    };
    if (aa.bZ) this.tK(aa);
    var dN = aa.ao.childNodes[0].childNodes;
    var Count = dN.length;
    if (Count > 1) {
        if (((dN[1].style.display != "none") || (mode == 1)) && (mode != 2)) {
            this.cB.childNodes[0].border = "1";
            this.cB.childNodes[0].border = "0";
            zJ = "none"
        } else zJ = "";
        for (var i = 1; i < Count; i++) dN[i].style.display = zJ
    };
    this.cE(aa)
};
dhtmlXTreeObject.prototype.dD = function(aa) {
    var z = aa.ao.childNodes[0].childNodes;
    if (z.length <= 1) return 0;
    if (z[1].style.display != "none") return 1;
    else return - 1
};
dhtmlXTreeObject.prototype.Mk = function() {
    var that = this.parentObject.treeNod;
    if (!that.callEvent("onDblClick", [this.parentObject.id, that])) return false;
    if ((this.parentObject.ro) && (this.parentObject.ro != "0")) that.kK(this.parentObject);
    else that.kK(this.parentObject, 2);
    if (that.mR("onOpenEnd")) if (!that.ku) that.callEvent("onOpenEnd", [this.parentObject.id, that.dD(this.parentObject)]);
    else {
        that.HM.push(that.onXLE);
        that.onXLE = that.FW
    };
    return false
};
dhtmlXTreeObject.prototype.PR = function() {
    var that = this.parentObject.treeNod;
    if (!that.callEvent("onOpenStart", [this.parentObject.id, that.dD(this.parentObject)])) return 0;
    if ((this.parentObject.ro) && (this.parentObject.ro != "0")) that.kK(this.parentObject);
    else that.kK(this.parentObject, 2);
    if (that.mR("onOpenEnd")) if (!that.ku) that.callEvent("onOpenEnd", [this.parentObject.id, that.dD(this.parentObject)]);
    else {
        that.HM.push(that.onXLE);
        that.onXLE = that.FW
    }
};
dhtmlXTreeObject.prototype.FW = function(that, id, mt) {
    if (id != this.fO) this.callEvent("onOpenEnd", [id, that.KL(id)]);
    that.onXLE = that.HM.pop();
    if (!mt && !that.HM.length) if (that.onXLE) that.onXLE(that, id)
};
dhtmlXTreeObject.prototype.aiY = function(e) {
    e = e || window.event;
    var that = this.parentObject.treeNod;
    that.yM(this.parentObject, e)
};
dhtmlXTreeObject.prototype.getSelectedItemId = function() {
    var str = new Array();
    for (var i = 0; i < this._selected.length; i++) str[i] = this._selected[i].id;
    return (str.join(this.jB))
};
dhtmlXTreeObject.prototype.yM = function(node, e) {
    if (this.mR("onSelect")) this.aaM = this.getSelectedItemId();
    if ((!this.Wj) || (!e) || ((!e.ctrlKey) && (!e.metaKey) && (!e.shiftKey))) this.Fo();
    if ((node.tA) && (this.Wj) && (e) && (e.ctrlKey || e.metaKey)) this.rH(node);
    else if ((!node.tA) && ((!this.aim) || (this._selected.length == 0) || (this._selected[0].parentObject == node.parentObject))) if ((this.Wj) && (e) && (e.shiftKey) && (this._selected.length != 0) && (this._selected[this._selected.length - 1].parentObject == node.parentObject)) {
        var a = this.SA(this._selected[this._selected.length - 1]);
        var b = this.SA(node);
        if (b < a) {
            var c = a;
            a = b;
            b = c
        };
        for (var i = a; i <= b; i++) if (!node.parentObject.childNodes[i].tA) this.qy(node.parentObject.childNodes[i])
    } else this.qy(node);
    if (this.mR("onSelect")) {
        var z = this.getSelectedItemId();
        if (z != this.aaM) this.callEvent("onSelect", [z])
    }
};
dhtmlXTreeObject.prototype.qy = function(node) {
    if (node.mB) node.span.style.color = node.mB;
    node.span.className = "selectedTreeRow";
    node.tA = true;
    this._selected[this._selected.length] = node
};
dhtmlXTreeObject.prototype.akg = function(itemId) {
    var z = this.ak(itemId);
    if (!z) return null;
    return this.SA(z)
};
dhtmlXTreeObject.prototype.SA = function(w) {
    var z = w.parentObject;
    for (var i = 0; i < z.aE; i++) if (z.childNodes[i] == w) return i
};
dhtmlXTreeObject.prototype.rH = function(node) {
    if ((node) && (node.tA)) {
        node.span.className = "standartTreeRow";
        if (node.kP) node.span.style.color = node.kP;
        node.tA = false;
        for (var i = 0; i < this._selected.length; i++) if (!this._selected[i].tA) {
            this._selected.splice(i, 1);
            break
        }
    }
};
dhtmlXTreeObject.prototype.Fo = function() {
    for (var i = 0; i < this._selected.length; i++) {
        var node = this._selected[i];
        node.span.className = "standartTreeRow";
        if (node.kP) node.span.style.color = node.kP;
        node.tA = false
    };
    this._selected = new Array()
};
dhtmlXTreeObject.prototype.onRowSelect = function(e, aI, mode) {
    e = e || window.event;
    var obj = this.parentObject;
    if (aI) obj = aI.parentObject;
    var that = obj.treeNod;
    var adi = that.getSelectedItemId();
    if ((!e) || (!e.adQ)) that.yM(obj, e);
    if (!mode) {
        if (obj.eP) obj.eP(obj.id, adi);
        else that.callEvent("onClick", [obj.id, adi])
    }
};
dhtmlXTreeObject.prototype.gU = function(Ll) {
    if (!this.tO) return;
    if (!Ll) return;
    if (Ll.id == this.fO) return;
    var act = Ll.childNodes;
    var UL = 0;
    var abQ = 0;
    if (Ll.aE == 0) return;
    for (var i = 0; i < Ll.aE; i++) {
        if (act[i].vO) continue;
        if (act[i].cY == 0) UL = 1;
        else if (act[i].cY == 1) abQ = 1;
        else {
            UL = 1;
            abQ = 1;
            break
        }
    };
    if ((UL) && (abQ)) this.bL(Ll, "unsure");
    else if (UL) this.bL(Ll, false);
    else this.bL(Ll, true);
    this.gU(Ll.parentObject)
};
dhtmlXTreeObject.prototype.DT = function(e) {
    if (!this.treeNod.callEvent("onBeforeCheck", [this.parentObject.id, this.parentObject.cY])) return;
    if (this.parentObject.vO) return true;
    if (this.treeNod.tO) if (this.parentObject.cY == 1) this.treeNod.iE(false, this.parentObject);
    else this.treeNod.iE(true, this.parentObject);
    else if (this.parentObject.cY == 1) this.treeNod.bL(this.parentObject, false);
    else this.treeNod.bL(this.parentObject, true);
    this.treeNod.gU(this.parentObject.parentObject);
    return this.treeNod.callEvent("onCheck", [this.parentObject.id, this.parentObject.cY])
};
dhtmlXTreeObject.prototype.ux = function(acheck, aa, mode) {
    var table = document.createElement('table');
    table.cellSpacing = 0;
    table.cellPadding = 0;
    table.border = 0;
    if (this.acX) table.style.tableLayout = "fixed";
    table.style.margin = 0;
    table.style.padding = 0;
    var tbody = document.createElement('tbody');
    var tr = document.createElement('tr');
    var xp = document.createElement('td');
    xp.className = "standartTreeImage";
    if (this.Lu) {
        var CD = document.createElement("div");
        xp.appendChild(CD);
        CD.className = "dhx_tree_textSign"
    } else {
        var CD = this.Lg(aa.id);
        CD.border = "0";
        if (CD.tagName == "IMG") CD.align = "absmiddle";
        xp.appendChild(CD);
        CD.style.padding = 0;
        CD.style.margin = 0;
        CD.style.width = this.Rr;
        CD.style.height = this.QQ
    };
    var abR = document.createElement('td');
    var inp = this.Lg(this.ahe ? this.fO: aa.id);
    inp.checked = 0;
    this.Rx(inp, this.mF + this.Bq[0]);
    inp.style.width = "16px";
    inp.style.height = "16px";
    if (!acheck)((!_isIE) ? abR: inp).style.display = "none";
    abR.appendChild(inp);
    if ((!this.ahe) && (inp.tagName == "IMG")) inp.align = "absmiddle";
    inp.onclick = this.DT;
    inp.treeNod = this;
    inp.parentObject = aa;
    if (!window._KHTMLrv) abR.width = "20px";
    else abR.width = "16px";
    var Rm = document.createElement('td');
    Rm.className = "standartTreeImage";
    var img = this.Lg(this.We ? aa.id: this.fO);
    img.onmousedown = this.kY;
    img.ondragstart = this.kY;
    img.border = "0";
    if (this.Jm) {
        img.parentObject = aa;
        if (img.tagName == "IMG") img.align = "absmiddle";
        img.onclick = this.onRowSelect
    };
    if (!mode) this.Rx(img, this.iconURL + this.gZ[0]);
    Rm.appendChild(img);
    img.style.padding = 0;
    img.style.margin = 0;
    if (this.We) {
        Rm.style.width = img.style.width = this.ST;
        img.style.height = this.SR
    } else {
        img.style.width = "0px";
        img.style.height = "0px";
        if (cU) Rm.style.display = "none"
    };
    var Bb = document.createElement('td');
    Bb.className = "standartTreeRow";
    aa.span = document.createElement('span');
    aa.span.className = "standartTreeRow";
    if (this.Li) {
        aa.span.style.width = this.Li;
        aa.span.style.display = "block"
    } else Bb.noWrap = true;
    if (_isIE && _isIE > 7) Bb.style.width = "999999px";
    else if (!window._KHTMLrv) Bb.style.width = "100%";
    aa.span.innerHTML = aa.label;
    Bb.appendChild(aa.span);
    Bb.parentObject = aa;
    xp.parentObject = aa;
    Bb.onclick = this.onRowSelect;
    xp.onclick = this.PR;
    Bb.ondblclick = this.Mk;
    if (this.anL) tr.title = aa.label;
    if (this.nz) {
        if (this.Jm) {
            this.M.dS(Rm, this);
            Rm.parentObject = aa
        };
        this.M.dS(Bb, this)
    };
    aa.span.style.paddingLeft = "5px";
    aa.span.style.paddingRight = "5px";
    Bb.style.verticalAlign = "";
    Bb.style.fontSize = "10pt";
    Bb.style.cursor = this.Id;
    tr.appendChild(xp);
    tr.appendChild(abR);
    tr.appendChild(Rm);
    tr.appendChild(Bb);
    tbody.appendChild(tr);
    table.appendChild(tbody);
    if (this.WG || this.mR("onMouseIn") || this.mR("onMouseOut")) {
        tr.onmousemove = this.Jf;
        tr[(_isIE) ? "onmouseleave": "onmouseout"] = this.It
    };
    return table
};
dhtmlXTreeObject.prototype.setImagePath = function(aiO) {
    this.mF = easytogo_basepath + aiO;
    this.iconURL = easytogo_basepath + aiO
};
dhtmlXTreeObject.prototype.setIconPath = function(path) {
    this.iconURL = easytogo_basepath + path
};
dhtmlXTreeObject.prototype.As = function(at) {
    var a = 0;
    for (var b = 0; b < at.aE; b++) if (at.childNodes[b].aE == 0) a++;
    return a
};
dhtmlXTreeObject.prototype.Zd = function(itemId) {
    var AT = this.ak(itemId);
    if (!AT) return 0;
    if ((AT.bZ) || ((!AT.fS) && (this.fs))) return AT.ph;
    switch (this.fo) {
    case 1:
        return AT.aE;
        break;
    case 2:
        return this.As(AT);
        break;
    case 3:
        return AT.ph;
        break;
    case 4:
        return AT.ph;
        break
    }
};
dhtmlXTreeObject.prototype.fH = function(at, index) {
    if (this.fo == null) return;
    if ((at.bZ) || ((!at.fS) && (this.fs))) {
        if (at.ph) at.span.innerHTML = at.label + this.sP + at.ph + this.htmlcB;
        else at.span.innerHTML = at.label;
        return
    };
    switch (this.fo) {
    case 1:
        if (at.aE != 0) at.span.innerHTML = at.label + this.sP + at.aE + this.htmlcB;
        else at.span.innerHTML = at.label;
        break;
    case 2:
        var z = this.As(at);
        if (z != 0) at.span.innerHTML = at.label + this.sP + z + this.htmlcB;
        else at.span.innerHTML = at.label;
        break;
    case 3:
        if (at.aE != 0) {
            var Tv = 0;
            for (var a = 0; a < at.aE; a++) {
                if (!at.childNodes[a].ph) at.childNodes[a].ph = 0;
                Tv += at.childNodes[a].ph * 1
            };
            Tv += at.aE * 1;
            at.span.innerHTML = at.label + this.sP + Tv + this.htmlcB;
            at.ph = Tv
        } else {
            at.span.innerHTML = at.label;
            at.ph = 0
        };
        if ((at.parentObject) && (at.parentObject != this.ao)) this.fH(at.parentObject);
        break;
    case 4:
        if (at.aE != 0) {
            var Tv = 0;
            for (var a = 0; a < at.aE; a++) {
                if (!at.childNodes[a].ph) at.childNodes[a].ph = 1;
                Tv += at.childNodes[a].ph * 1
            };
            at.span.innerHTML = at.label + this.sP + Tv + this.htmlcB;
            at.ph = Tv
        } else {
            at.span.innerHTML = at.label;
            at.ph = 1
        };
        if ((at.parentObject) && (at.parentObject != this.ao)) this.fH(at.parentObject);
        break
    }
};
dhtmlXTreeObject.prototype.setChildCalcMode = function(mode) {
    switch (mode) {
    case "child":
        this.fo = 1;
        break;
    case "leafs":
        this.fo = 2;
        break;
    case "childrec":
        this.fo = 3;
        break;
    case "leafsrec":
        this.fo = 4;
        break;
    case "disabled":
        this.fo = null;
        break;
    default:
        this.fo = 4
    }
};
dhtmlXTreeObject.prototype.aeX = function(ang, anh) {
    this.sP = ang;
    this.htmlcB = anh
};
dhtmlXTreeObject.prototype.setOnRightClickHandler = function(aQ) {
    this.attachEvent("onRightClick", aQ)
};
dhtmlXTreeObject.prototype.setOnClickHandler = function(aQ) {
    this.attachEvent("onClick", aQ)
};
dhtmlXTreeObject.prototype.YD = function(aQ) {
    this.attachEvent("onSelect", aQ)
};
dhtmlXTreeObject.prototype.setXMLAutoLoading = function(bU) {
    this.fs = bU
};
dhtmlXTreeObject.prototype.setOnCheckHandler = function(aQ) {
    this.attachEvent("onCheck", aQ)
};
dhtmlXTreeObject.prototype.setOnOpenHandler = function(aQ) {
    this.attachEvent("onOpenStart", aQ)
};
dhtmlXTreeObject.prototype.Gm = function(aQ) {
    this.attachEvent("onOpenStart", aQ)
};
dhtmlXTreeObject.prototype.rV = function(aQ) {
    this.attachEvent("onOpenEnd", aQ)
};
dhtmlXTreeObject.prototype.setOnDblClickHandler = function(aQ) {
    this.attachEvent("onDblClick", aQ)
};
dhtmlXTreeObject.prototype.openAllItems = function(itemId) {
    var AT = this.ak(itemId);
    if (!AT) return 0;
    this.SP(AT)
};
dhtmlXTreeObject.prototype.KL = function(itemId) {
    var AT = this.ak(itemId);
    if (!AT) return "";
    return this.dD(AT)
};
dhtmlXTreeObject.prototype.closeAllItems = function(itemId) {
    if (itemId === window.undefined) itemId = this.fO;
    var AT = this.ak(itemId);
    if (!AT) return 0;
    this.Ho(AT);
    this.cB.childNodes[0].border = "1";
    this.cB.childNodes[0].border = "0"
};
dhtmlXTreeObject.prototype.setUserData = function(itemId, name, value) {
    var aX = this.ak(itemId, 0, true);
    if (!aX) return;
    if (name == "hint") aX.ao.childNodes[0].childNodes[0].title = value;
    if (typeof(aX.userData["t_" + name]) == "undefined") {
        if (!aX.PJ) aX.PJ = name;
        else aX.PJ += "," + name
    };
    aX.userData["t_" + name] = value
};
dhtmlXTreeObject.prototype.getUserData = function(itemId, name) {
    var aX = this.ak(itemId, 0, true);
    if (!aX) return;
    return aX.userData["t_" + name]
};
dhtmlXTreeObject.prototype.akk = function(itemId) {
    var AT = this.ak(itemId);
    if (!AT) return 0;
    var res = new Object();
    if (AT.kP) res.kP = AT.kP;
    if (AT.mB) res.mB = AT.mB;
    return res
};
dhtmlXTreeObject.prototype.setItemColor = function(itemId, wo, vf) {
    if ((itemId) && (itemId.span)) var AT = itemId;
    else var AT = this.ak(itemId);
    if (!AT) return 0;
    else {
        if (AT.tA) {
            if (vf) AT.span.style.color = vf
        } else {
            if (wo) AT.span.style.color = wo
        };
        if (vf) AT.mB = vf;
        if (wo) AT.kP = wo
    }
};
dhtmlXTreeObject.prototype.getItemText = function(itemId) {
    var AT = this.ak(itemId);
    if (!AT) return 0;
    return (AT.ao.childNodes[0].childNodes[0].childNodes[3].childNodes[0].innerHTML)
};
dhtmlXTreeObject.prototype.getParentId = function(itemId) {
    var AT = this.ak(itemId);
    if ((!AT) || (!AT.parentObject)) return "";
    return AT.parentObject.id
};
dhtmlXTreeObject.prototype.changeItemId = function(itemId, fW) {
    if (itemId == fW) return;
    var AT = this.ak(itemId);
    if (!AT) return 0;
    AT.id = fW;
    AT.span.contextMenuId = fW;
    this.gQ[fW] = this.gQ[itemId];
    delete this.gQ[itemId]
};
dhtmlXTreeObject.prototype.doCut = function() {
    if (this.rN) this.Xd();
    this.rN = (new Array()).concat(this._selected);
    for (var i = 0; i < this.rN.length; i++) {
        var mN = this.rN[i];
        mN.FH = new Array();
        mN.FH[0] = mN.images[0];
        mN.FH[1] = mN.images[1];
        mN.FH[2] = mN.images[2];
        mN.images[0] = mN.images[1] = mN.images[2] = this.agE;
        this.cE(mN)
    }
};
dhtmlXTreeObject.prototype.doPaste = function(itemId) {
    var tobj = this.ak(itemId);
    if (!tobj) return 0;
    for (var i = 0; i < this.rN.length; i++) {
        if (this.wj(tobj, this.rN[i])) continue;
        this.SO(this.rN[i], tobj)
    };
    this.Xd()
};
dhtmlXTreeObject.prototype.Xd = function() {
    for (var i = 0; i < this.rN.length; i++) {
        var mN = this.rN[i];
        mN.images[0] = mN.FH[0];
        mN.images[1] = mN.FH[1];
        mN.images[2] = mN.FH[2];
        this.cE(mN)
    };
    this.rN = new Array()
};
dhtmlXTreeObject.prototype.SO = function(aa, bn) {
    var mode = this.ll;
    if (mode == 1) {
        var z = bn;
        if (this.mW < 0) {
            while (true) {
                z = this.pR(z);
                if ((z == -1)) {
                    z = this.ao;
                    break
                };
                if ((z.tr == 0) || (z.tr.style.display == "") || (!z.parentObject)) break
            };
            var abe = z;
            var HU = bn
        } else {
            while (true) {
                z = this.ob(z);
                if ((z == -1)) {
                    z = this.ao;
                    break
                };
                if ((z.tr.style.display == "") || (!z.parentObject)) break
            };
            var HU = z;
            var abe = bn
        };
        if (this.uU(abe, 0) > this.uU(HU, 0)) {
            if (!this.aep) return this.fJ(aa, abe.parentObject);
            else if (HU.id != this.fO) return this.fJ(aa, HU.parentObject, HU);
            else return this.fJ(aa, this.ao, null)
        } else {
            return this.fJ(aa, HU.parentObject, HU)
        }
    } else return this.fJ(aa, bn)
};
dhtmlXTreeObject.prototype.xE = function(target, ZC) {
    var mt = 0;
    var ari = 0;
    var dN = target.childNodes;
    var Count = target.aE - 1;
    if (ZC == dN[Count]) return;
    for (var i = 0; i < Count; i++) if (dN[i] == dN[Count]) {
        dN[i] = dN[i + 1];
        dN[i + 1] = dN[Count]
    };
    for (var i = 0; i < Count + 1; i++) {
        if (mt) {
            var AT = dN[i];
            dN[i] = mt;
            mt = AT
        } else if (dN[i] == ZC) {
            mt = dN[i];
            dN[i] = dN[Count]
        }
    }
};
dhtmlXTreeObject.prototype.DL = function(aa, bn, bT, gR) {
    var i;
    var st = "";
    if (bT) {
        for (i = 0; i < bn.aE; i++) if (bn.childNodes[i] == bT) break;
        if (i != 0) bT = bn.childNodes[i - 1];
        else {
            st = "TOP";
            bT = ""
        }
    };
    var arM = this.BX;
    this.BX = null;
    var fi = this.kV(bn, aa.id, aa.label, 0, aa.images[0], aa.images[1], aa.images[2], st, 0, bT);
    fi.PJ = aa.PJ;
    fi.userData = aa.userData.QF();
    fi.fS = aa.fS;
    if (arM) {
        this.BX = arM;
        this.BX(fi.id)
    };
    if (aa.treeNod.BM) aa.treeNod.ak(aa.id);
    else fi.bZ = aa.bZ;
    this.cE(fi);
    for (var i = 0; i < aa.aE; i++) this.DL(aa.childNodes[i], fi, 0, 1);
    if ((!gR) && (this.fo)) {
        this.jm(this, bn)
    };
    return fi
};
dhtmlXTreeObject.prototype.fJ = function(aa, bn, bT) {
    if (aa.treeNod.oy) return aa.treeNod.oy(this, bn, bT, aa);
    if (bn.acE) var Bn = (aa.treeNod.Rs != bn.Rs);
    else var Bn = (aa.treeNod.Rs != bn.treeNod.Rs);
    if (!this.callEvent("onDrag", [aa.id, bn.id, (bT ? bT.id: null), aa.treeNod, bn.treeNod])) return false;
    if ((bn.fS == 0) && (this.fs)) {
        bn.fS = 1;
        this.pA(bn.id)
    };
    this.openItem(bn.id);
    var hP = aa.treeNod;
    var c = aa.parentObject.aE;
    var z = aa.parentObject;
    if ((Bn) || (hP.BM)) {
        var alp = aa.id;
        aa = this.DL(aa, bn, bT);
        if (!hP.BM) hP.deleteItem(alp)
    } else {
        var Count = bn.aE;
        var dN = bn.childNodes;
        if (Count == 0) bn.ahl = true;
        hP.rH(aa);
        dN[Count] = aa;
        aa.treeNod = bn.treeNod;
        bn.aE++;
        var tr = this.YT(dN[Count].ao);
        if (!bT) {
            bn.ao.childNodes[0].appendChild(tr);
            if (this.mj == 1) this.xE(bn, bT)
        } else {
            bn.ao.childNodes[0].insertBefore(tr, bT.tr);
            this.xE(bn, bT);
            dN = bn.childNodes
        }
    };
    if ((!hP.BM) && (!Bn)) {
        var aow = aa.tr;
        if ((document.all) && (navigator.appVersion.search(/MSIE\ 5\.0/gi) != -1)) {
            window.setTimeout(function() {
                aow.parentNode.removeChild(aow)
            },
            250)
        } else aa.parentObject.ao.childNodes[0].removeChild(aa.tr);
        if ((!bT) || (bn != aa.parentObject)) {
            for (var i = 0; i < z.aE; i++) {
                if (z.childNodes[i].id == aa.id) {
                    z.childNodes[i] = 0;
                    break
                }
            }
        } else z.childNodes[z.aE - 1] = 0;
        hP.Ak(z.aE, z.childNodes);
        z.aE--
    };
    if ((!Bn) && (!hP.BM)) {
        aa.tr = tr;
        tr.mX = aa;
        aa.parentObject = bn;
        if (hP != bn.treeNod) {
            if (aa.treeNod.DZ(aa, hP)) return;
            this.Ks(aa);
            this.jm(this, aa.parentObject)
        };
        this.cE(bn);
        this.gK(bn);
        this.gK(aa);
        this.cE(aa);
        if (bT) {
            this.cE(bT)
        } else if (bn.aE >= 2) {
            this.cE(dN[bn.aE - 2]);
            this.gK(dN[bn.aE - 2])
        };
        this.cE(dN[bn.aE - 1]);
        if (this.tO) this.gU(bn);
        if (hP.tO) hP.gU(z)
    };
    if (c > 1) {
        hP.cE(z.childNodes[c - 2]);
        hP.gK(z.childNodes[c - 2])
    };
    hP.cE(z);
    hP.gK(z);
    this.fH(bn);
    hP.fH(z);
    this.callEvent("onDrop", [aa.id, bn.id, (bT ? bT.id: null), hP, bn.treeNod]);
    return aa.id
};
dhtmlXTreeObject.prototype.Ks = function(aa) {
    if (!aa.ao) return;
    var xp = aa.ao.childNodes[0].childNodes[0].childNodes[1];
    var ade = xp.nextSibling.nextSibling;
    aa.span.innerHTML = aa.label;
    aa.tA = false;
    if (aa.Jm) this.M.fG(xp.nextSibling);
    if (this.ps) {
        xp.childNodes[0].style.display = "";
        xp.childNodes[0].onclick = this.DT;
        this.Rx(xp.childNodes[0], this.mF + this.Bq[aa.cY])
    } else xp.childNodes[0].style.display = "none";
    xp.childNodes[0].treeNod = this;
    this.M.fG(ade);
    if (this.nz) this.M.dS(ade, this);
    if (this.Jm) this.M.dS(xp.nextSibling, this);
    ade.childNodes[0].className = "standartTreeRow";
    ade.onclick = this.onRowSelect;
    ade.ondblclick = this.Mk;
    xp.previousSibling.onclick = this.PR;
    this.gK(aa);
    this.cE(aa);
    for (var i = 0; i < aa.aE; i++) this.Ks(aa.childNodes[i])
};
dhtmlXTreeObject.prototype.DZ = function(aa, hP) {
    if (hP) hP.rW(aa.id);
    aa.id = this.oh(aa.id, aa);
    aa.treeNod = this;
    for (var i = 0; i < aa.aE; i++) this.DZ(aa.childNodes[i], hP);
    return 0
};
dhtmlXTreeObject.prototype.enableThreeStateCheckboxes = function(mode) {
    this.tO = K(mode)
};
dhtmlXTreeObject.prototype.acp = function(aQ) {
    this.WG = true;
    this.attachEvent("onMouseIn", aQ)
};
dhtmlXTreeObject.prototype.aaE = function(aQ) {
    this.WG = true;
    this.attachEvent("onMouseOut", aQ)
};
dhtmlXTreeObject.prototype.enableMercyDrag = function(mode) {
    this.BM = K(mode)
};
dhtmlXTreeObject.prototype.enableTreeImages = function(mode) {
    this.We = K(mode)
};
dhtmlXTreeObject.prototype.ahS = function(mode) {
    this.acX = K(mode)
};
dhtmlXTreeObject.prototype.enableCheckBoxes = function(mode, hidden) {
    this.ps = K(mode);
    this.ahe = (!(this.ps || K(hidden)))
};
dhtmlXTreeObject.prototype.setStdImages = function(kQ, kS, nI) {
    this.gZ[0] = kQ;
    this.gZ[1] = kS;
    this.gZ[2] = nI
};
dhtmlXTreeObject.prototype.enableTreeLines = function(mode) {
    this.Fc = K(mode)
};
dhtmlXTreeObject.prototype.setImageArrays = function(acL, kQ, kS, nI, aes, aeq) {
    switch (acL) {
    case "plus":
        this.nj[0] = kQ;
        this.nj[1] = kS;
        this.nj[2] = nI;
        this.nj[3] = aes;
        this.nj[4] = aeq;
        break;
    case "minus":
        this.mQ[0] = kQ;
        this.mQ[1] = kS;
        this.mQ[2] = nI;
        this.mQ[3] = aes;
        this.mQ[4] = aeq;
        break
    }
};
dhtmlXTreeObject.prototype.openItem = function(itemId) {
    var AT = this.ak(itemId);
    if (!AT) return 0;
    else return this.nk(AT)
};
dhtmlXTreeObject.prototype.nk = function(item) {
    var state = this.dD(item);
    if ((state < 0) || (((this.fs) && (!item.fS)))) {
        if (!this.callEvent("onOpenStart", [item.id, state])) return 0;
        this.kK(item, 2);
        if (this.mR("onOpenEnd")) {
            if (this.onXLE == this.FW) this.FW(this, item.id, true);
            if (!this.ku || !this.fs) this.callEvent("onOpenEnd", [item.id, this.dD(item)]);
            else {
                this.HM.push(this.onXLE);
                this.onXLE = this.FW
            }
        }
    } else if (this.ahK) this.kK(item, 2);
    if (item.parentObject && !this._skip_open_parent) this.nk(item.parentObject)
};
dhtmlXTreeObject.prototype.closeItem = function(itemId) {
    if (this.fO == itemId) return 0;
    var AT = this.ak(itemId);
    if (!AT) return 0;
    if (AT.ro) this.kK(AT, 1)
};
dhtmlXTreeObject.prototype.getLevel = function(itemId) {
    var AT = this.ak(itemId);
    if (!AT) return 0;
    return this.uU(AT, 0)
};
dhtmlXTreeObject.prototype.Cq = function(itemId, mt) {
    mt = K(mt);
    if ((itemId) && (itemId.span)) var AT = itemId;
    else var AT = this.ak(itemId);
    if (!AT) return 0;
    AT.ro = mt
};
dhtmlXTreeObject.prototype.uU = function(aa, count) {
    if (aa.parentObject) return this.uU(aa.parentObject, count + 1);
    return (count)
};
dhtmlXTreeObject.prototype.hasChildren = function(itemId) {
    var AT = this.ak(itemId);
    if (!AT) return 0;
    else {
        if ((this.fs) && (!AT.fS)) return true;
        else return AT.aE
    }
};
dhtmlXTreeObject.prototype.As = function(at) {
    var a = 0;
    for (var b = 0; b < at.aE; b++) if (at.childNodes[b].aE == 0) a++;
    return a
};
dhtmlXTreeObject.prototype.setItemText = function(itemId, VK, OS) {
    var AT = this.ak(itemId);
    if (!AT) return 0;
    AT.label = VK;
    AT.span.innerHTML = VK;
    if (this.fo) this.fH(AT);
    AT.span.parentNode.parentNode.title = OS || ""
};
dhtmlXTreeObject.prototype.aiv = function(itemId) {
    var AT = this.ak(itemId);
    if (!AT) return "";
    return (AT.span.parentNode.parentNode.aob || AT.span.parentNode.parentNode.title || "")
};
dhtmlXTreeObject.prototype.refreshItem = function(itemId) {
    if (!itemId) itemId = this.fO;
    var AT = this.ak(itemId);
    this.deleteChildItems(itemId);
    this.pA(itemId)
};
dhtmlXTreeObject.prototype.setItemImage2 = function(itemId, kQ, kS, nI) {
    var AT = this.ak(itemId);
    if (!AT) return 0;
    AT.images[1] = kS;
    AT.images[2] = nI;
    AT.images[0] = kQ;
    this.cE(AT)
};
dhtmlXTreeObject.prototype.setItemImage = function(itemId, kQ, kS) {
    var AT = this.ak(itemId);
    if (!AT) return 0;
    if (kS) {
        AT.images[1] = kQ;
        AT.images[2] = kS
    } else AT.images[0] = kQ;
    this.cE(AT)
};
dhtmlXTreeObject.prototype.getSubItems = function(itemId) {
    var AT = this.ak(itemId, 0, 1);
    if (!AT) return 0;
    if (AT.bZ) return (this.Qo(AT.bZ));
    var z = "";
    for (i = 0; i < AT.aE; i++) {
        if (!z) z = AT.childNodes[i].id;
        else z += this.jB + AT.childNodes[i].id
    };
    return z
};
dhtmlXTreeObject.prototype.oi = function(node) {
    var z = "";
    for (var i = 0; i < node.aE; i++) {
        if ((node.childNodes[i].bZ) || (node.childNodes[i].aE > 0)) {
            if (node.childNodes[i].bZ) var zb = this.uD(node.childNodes[i].bZ, 1);
            else var zb = this.oi(node.childNodes[i]);
            if (zb) if (z) z += this.jB + zb;
            else z = zb
        } else if (!z) z = node.childNodes[i].id;
        else z += this.jB + node.childNodes[i].id
    };
    return z
};
dhtmlXTreeObject.prototype.sj = function(node) {
    var z = "";
    for (var i = 0; i < node.aE; i++) {
        if ((node.childNodes[i].bZ) || (node.childNodes[i].aE > 0)) {
            if (!z) z = node.childNodes[i].id;
            else z += this.jB + node.childNodes[i].id;
            if (node.childNodes[i].bZ) var zb = this.zW(node.childNodes[i].bZ, 1);
            else var zb = this.sj(node.childNodes[i]);
            if (zb) z += this.jB + zb
        }
    };
    return z
};
dhtmlXTreeObject.prototype.DK = function(itemId, z, node) {
    if (node) AT = node;
    else {
        var AT = this.ak(itemId)
    };
    if (!AT) return 0;
    z = "";
    for (var i = 0; i < AT.aE; i++) {
        if (!z) z = AT.childNodes[i].id;
        else z += this.jB + AT.childNodes[i].id;
        var zb = this.DK(0, z, AT.childNodes[i]);
        if (zb) z += this.jB + zb
    };
    if (AT.bZ) z = this.Ku(itemId, z, AT.bZ);
    return z
};
dhtmlXTreeObject.prototype.selectItem = function(itemId, mode, iW) {
    mode = K(mode);
    var AT = this.ak(itemId);
    if ((!AT) || (!AT.parentObject)) return 0;
    if (this.ek) AT.parentObject.Xm = 1;
    else this.nk(AT.parentObject);
    var ze = null;
    if (iW) {
        ze = new Object;
        ze.ctrlKey = true;
        if (AT.tA) ze.adQ = true
    };
    if (mode) this.onRowSelect(ze, AT.ao.childNodes[0].childNodes[0].childNodes[3], false);
    else this.onRowSelect(ze, AT.ao.childNodes[0].childNodes[0].childNodes[3], true)
};
dhtmlXTreeObject.prototype.xB = function() {
    var str = new Array();
    for (var i = 0; i < this._selected.length; i++) str[i] = this._selected[i].span.innerHTML;
    return (str.join(this.jB))
};
dhtmlXTreeObject.prototype.Ak = function(Count, dN) {
    Count--;
    for (var i = 0; i < Count; i++) {
        if (dN[i] == 0) {
            dN[i] = dN[i + 1];
            dN[i + 1] = 0
        }
    }
};
dhtmlXTreeObject.prototype.My = function(itemId, aI, Ch) {
    if ((!aI) || (!aI.parentObject)) return 0;
    var PQ = 0;
    var Ls = 0;
    if (aI.tr.nextSibling) PQ = aI.tr.nextSibling.mX;
    if (aI.tr.previousSibling) Ls = aI.tr.previousSibling.mX;
    var sN = aI.parentObject;
    var Count = sN.aE;
    var dN = sN.childNodes;
    for (var i = 0; i < Count; i++) {
        if (dN[i].id == itemId) {
            if (!Ch) sN.ao.childNodes[0].removeChild(dN[i].tr);
            dN[i] = 0;
            break
        }
    };
    this.Ak(Count, dN);
    if (!Ch) {
        sN.aE--
    };
    if (PQ) {
        this.cE(PQ);
        this.gK(PQ)
    };
    if (Ls) {
        this.cE(Ls);
        this.gK(Ls)
    };
    if (this.tO) this.gU(sN);
    if (!Ch) {
        this.us(aI)
    }
};
dhtmlXTreeObject.prototype.setCheck = function(itemId, state) {
    var aX = this.ak(itemId, 0, 1);
    if (!aX) return;
    if (state === "unsure") this.bL(aX, state);
    else {
        state = K(state);
        if ((this.tO) && (this.xL)) this.iE(state, aX);
        else this.bL(aX, state)
    };
    if (this.xL) this.gU(aX.parentObject)
};
dhtmlXTreeObject.prototype.bL = function(aX, state) {
    if (!aX) return;
    if (((aX.parentObject.nN) || (this.Co)) && (state)) if (this.aih) {
        if (this.Zk) this.setCheck(this.Zk.id, 0);
        this.Zk = aX
    } else for (var i = 0; i < aX.parentObject.aE; i++) this.bL(aX.parentObject.childNodes[i], 0);
    var z = aX.ao.childNodes[0].childNodes[0].childNodes[1].childNodes[0];
    if (state == "unsure") aX.cY = 2;
    else if (state) aX.cY = 1;
    else aX.cY = 0;
    if (aX.vO) aX.cY = aX.vO;
    this.Rx(z, this.mF + ((aX.parentObject.nN || this.Co) ? this.GR: this.Bq)[aX.cY])
};
dhtmlXTreeObject.prototype.setSubChecked = function(itemId, state) {
    var aX = this.ak(itemId);
    this.iE(state, aX);
    this.gU(aX.parentObject)
};
dhtmlXTreeObject.prototype.iE = function(state, aX) {
    state = K(state);
    if (!aX) return;
    if (((aX.parentObject.nN) || (this.Co)) && (state)) for (var i = 0; i < aX.parentObject.aE; i++) this.iE(0, aX.parentObject.childNodes[i]);
    if (aX.bZ) this.LT(state, aX.bZ);
    if (aX.nN || this.Co) this.iE(state, aX.childNodes[0]);
    else for (var i = 0; i < aX.aE; i++) {
        this.iE(state, aX.childNodes[i])
    };
    var z = aX.ao.childNodes[0].childNodes[0].childNodes[1].childNodes[0];
    if (state) aX.cY = 1;
    else aX.cY = 0;
    if (aX.vO) aX.cY = aX.vO;
    this.Rx(z, this.mF + ((aX.parentObject.nN || this.Co) ? this.GR: this.Bq)[aX.cY])
};
dhtmlXTreeObject.prototype.ajT = function(itemId) {
    var aX = this.ak(itemId);
    if (!aX) return;
    return aX.cY
};
dhtmlXTreeObject.prototype.deleteChildItems = function(itemId) {
    var aX = this.ak(itemId);
    if (!aX) return;
    var j = aX.aE;
    for (var i = 0; i < j; i++) {
        this.My(aX.childNodes[0].id, aX.childNodes[0])
    }
};
dhtmlXTreeObject.prototype.deleteItem = function(itemId, tu) {
    if ((!this.ajc) || (this.ajc(itemId))) {
        var z = this.XO(itemId, tu);
        this.fH(z)
    };
    this.cB.childNodes[0].border = "1";
    this.cB.childNodes[0].border = "0"
};
dhtmlXTreeObject.prototype.XO = function(itemId, tu, Ch) {
    tu = K(tu);
    var aX = this.ak(itemId);
    if (!aX) return;
    var qc = this.getParentId(itemId);
    var ZV = aX.parentObject;
    this.My(itemId, aX, Ch);
    this.cE(ZV);
    this.gK(ZV);
    if ((tu) && (qc != this.fO)) this.selectItem(qc, 1);
    return ZV
};
dhtmlXTreeObject.prototype.us = function(aa) {
    for (var i = 0; i < aa.aE; i++) {
        this.us(aa.childNodes[i]);
        this.rW(aa.childNodes[i].id)
    };
    this.rW(aa.id);
    var z = aa;
    z.span = null;
    z.tr.mX = null;
    z.tr = null;
    z.ao = null
};
dhtmlXTreeObject.prototype.insertNewNext = function(itemId, fW, itemText, kA, kQ, kS, nI, kC, children) {
    var aX = this.ak(itemId);
    if ((!aX) || (!aX.parentObject)) return (0);
    var aaN = this.kV(0, fW, itemText, kA, kQ, kS, nI, kC, children, aX);
    if ((!this.ek) && (this.fo)) this.fH(aX.parentObject);
    return aaN
};
dhtmlXTreeObject.prototype.afD = function(itemId, index) {
    var z = this.ak(itemId);
    if ((!z) || (index >= z.aE)) return null;
    return z.childNodes[index].id
};
dhtmlXTreeObject.prototype.FI = function(itemId, index) {
    var z = this.ak(itemId);
    if ((!z) || (index >= z.aE)) return null;
    return z.childNodes[index].id
};
dhtmlXTreeObject.prototype.setDragHandler = function(aQ) {
    this.attachEvent("onDrag", aQ)
};
dhtmlXTreeObject.prototype.mH = function() {
    if (this.Ed) {
        this.Ed.className = this.Ed.className.replace(/dragAndDropRow/g, "");
        this.Ed = null
    };
    this.selectionBar.style.display = "none";
    this.cB.className = this.cB.className.replace(" selectionBox", "")
};
dhtmlXTreeObject.prototype.enableDragAndDrop = function(mode, rmode) {
    if (mode == "temporary_disabled") {
        this.ko = false;
        mode = true
    } else this.ko = true;
    this.nz = K(mode);
    if (this.nz) this.M.eH(this.cB, this);
    if (arguments.length > 1) this.ajC = (!K(rmode))
};
dhtmlXTreeObject.prototype.VN = function(ao, x, y) {
    if (ao.parentObject.span) {
        var a1 = dg(ao);
        var a2 = dg(this.cB);
        this.ll = this.mj;
        this.mW = 0;
        if (this.mj == 2) {
            var z = y - a1 + this.cB.scrollTop + (document.body.scrollTop || document.documentElement.scrollTop) - 2 - ao.offsetHeight / 2;
            if ((Math.abs(z) - ao.offsetHeight / 6) > 0) {
                this.ll = 1;
                if (z < 0) this.mW = 0 - ao.offsetHeight
            } else this.ll = 0
        };
        if (this.ll == 0) {
            var zN = ao.parentObject.span;
            zN.className += " dragAndDropRow";
            this.Ed = zN
        } else {
            this.mH();
            this.selectionBar.style.top = (a1 - a2 + ((parseInt(ao.parentObject.span.parentNode.previousSibling.childNodes[0].style.height) || 18) - 1) + this.mW) + "px";
            this.selectionBar.style.left = "5px";
            if (this.cB.offsetWidth > 20) this.selectionBar.style.width = (this.cB.offsetWidth - (aq ? 30 : 25)) + "px";
            this.selectionBar.style.display = ""
        };
        this.MC(null, a1, a2)
    }
};
dhtmlXTreeObject.prototype.MC = function(node, a1, a2) {
    if (this.PZ) {
        if (node) {
            a1 = dg(node);
            a2 = dg(this.cB)
        };
        if ((a1 - a2 - parseInt(this.cB.scrollTop)) > (parseInt(this.cB.offsetHeight) - 50)) this.cB.scrollTop = parseInt(this.cB.scrollTop) + 20;
        if ((a1 - a2) < (parseInt(this.cB.scrollTop) + 30)) this.cB.scrollTop = parseInt(this.cB.scrollTop) - 20
    }
};
dhtmlXTreeObject.prototype.gL = function(aI, e) {
    if (!this.ko) return null;
    var obj = aI.parentObject;
    if (!this.callEvent("onBeforeDrag", [obj.id])) return null;
    if (!obj.tA) this.yM(obj, e);
    this.wb();
    var fj = document.createElement('div');
    var text = new Array();
    if (this.Xy) for (var i = 0; i < this._selected.length; i++) text[i] = "<table cellspacing='0' cellpadding='0'><tr><td><img width='18px' height='18px' src='" + this.YW(this._selected[i].span.parentNode.previousSibling.childNodes[0]) + "'></td><td>" + this._selected[i].span.innerHTML + "</td></tr></table>";
    else text = this.xB().split(this.jB);
    fj.innerHTML = text.join("");
    fj.style.position = "absolute";
    fj.className = "dragSpanDiv";
    this.jG = (new Array()).concat(this._selected);
    return fj
};
dhtmlXTreeObject.prototype.QH = function(item) {
    var z = dg(item.ao) - dg(this.cB);
    if ((z > (this.cB.scrollTop + this.cB.offsetHeight - 30)) || (z < this.cB.scrollTop)) this.cB.scrollTop = z
};
dhtmlXTreeObject.prototype.kY = function(e) {
    if ((e) && (e.preventDefault)) {
        e.preventDefault();
        return false
    };
    return false
};
dhtmlXTreeObject.prototype.BK = function(la, Ll, il) {
    if (this.hg) clearTimeout(this.hg);
    if (!il.parentObject) {
        il = this.ao.ao.childNodes[0].childNodes[0].childNodes[1].childNodes[0];
        this.ll = 0
    };
    this.mH();
    var z = la.parentObject.treeNod;
    if ((z) && (z.mH)) z.mH("");
    if ((!this.MP) || (this.MP())) {
        if ((!z) || (!z.mH) || (!z.jG)) var col = new Array(la.parentObject);
        else var col = z.jG;
        var ZE = il.parentObject;
        for (var i = 0; i < col.length; i++) {
            var UI = this.SO(col[i], ZE);
            if ((this.ll) && (UI !== false)) ZE = this.ak(UI, true, true);
            if ((UI) && (!this.alG)) this.selectItem(UI, 0, 1)
        }
    };
    if (z) z.jG = new Array()
};
dhtmlXTreeObject.prototype.tY = function(aI, nq, x, y) {
    if (!this.ko) return 0;
    var abW = nq.parentObject;
    var tobj = aI.parentObject;
    if ((!tobj) && (this.ajC)) return;
    if (!this.callEvent("onDragIn", [abW.id, tobj ? tobj.id: null, abW.treeNod, this])) {
        if (tobj) this.MC(aI);
        return 0
    };
    if (!tobj) this.cB.className += " selectionBox";
    else {
        if (abW.childNodes == null) {
            this.VN(aI, x, y);
            return aI
        };
        var stree = abW.treeNod;
        for (var i = 0; i < stree.jG.length; i++) if (this.wj(tobj, stree.jG[i])) {
            this.MC(aI);
            return 0
        };
        this.selectionBar.parentNode.removeChild(this.selectionBar);
        tobj.span.parentNode.appendChild(this.selectionBar);
        this.VN(aI, x, y);
        if (this.dD(tobj) <= 0) {
            this.EV = tobj.id;
            this.hg = window.setTimeout(new jP(this.AN, this), 1000)
        }
    };
    return aI
};
dhtmlXTreeObject.prototype.AN = function(e, bG) {
    bG.openItem(bG.EV)
};
dhtmlXTreeObject.prototype.iX = function(aI) {
    this.mH();
    if (this.hg) clearTimeout(this.hg)
};
dhtmlXTreeObject.prototype.ob = function(item, mode) {
    if ((!mode) && (item.aE)) return item.childNodes[0];
    if (item == this.ao) return - 1;
    if ((item.tr) && (item.tr.nextSibling) && (item.tr.nextSibling.mX)) return item.tr.nextSibling.mX;
    return this.ob(item.parentObject, true)
};
dhtmlXTreeObject.prototype.qK = function(item) {
    if (item.aE) return this.qK(item.childNodes[item.aE - 1]);
    else return item
};
dhtmlXTreeObject.prototype.pR = function(node, mode) {
    if ((node.tr) && (node.tr.previousSibling) && (node.tr.previousSibling.mX)) return this.qK(node.tr.previousSibling.mX);
    if (node.parentObject) return node.parentObject;
    else return - 1
};
dhtmlXTreeObject.prototype.findItem = function(jU, direction, top) {
    var z = this.Cj(jU, direction, (top ? this.ao: null));
    if (z) {
        this.selectItem(z.id, true);
        this.QH(z);
        return z.id
    } else return null
};
dhtmlXTreeObject.prototype.aeM = function(jU, direction, top) {
    var z = this.Cj(jU, direction, (top ? this.ao: null));
    if (z) return z.id;
    else return null
};
dhtmlXTreeObject.prototype.sy = function(node, Le, acU) {
    if (!node.childNodes && node.item) return this.findStrInJSON(node, Le, acU);
    for (var i = 0; i < node.childNodes.length; i++) {
        if (node.childNodes[i].nodeType == 1) {
            var z = node.childNodes[i].getAttribute(Le);
            if (!z && node.childNodes[i].tagName == "itemtext") z = node.childNodes[i].firstChild.data;
            if ((z) && (z.toLowerCase().search(acU) != -1)) return true;
            if (this.sy(node.childNodes[i], Le, acU)) return true
        }
    };
    return false
};
dhtmlXTreeObject.prototype.findStrInJSON = function(node, Le, acU) {
    for (var i = 0; i < node.item.length; i++) {
        var z = node.item[i].text;
        if ((z) && (z.toLowerCase().search(acU) != -1)) return true;
        if (this.item[i].item && this.findStrInJSON(node.item[i], Le, acU)) return true
    };
    return false
};
dhtmlXTreeObject.prototype.Cj = function(jU, direction, dK) {
    var jU = jU.replace(new RegExp("^( )+"), "").replace(new RegExp("( )+$"), "");
    jU = new RegExp(jU.replace(/([\?\*\+\\\[\]\(\)]{1})/gi, "\\$1").replace(/ /gi, ".*"), "gi");
    if (!dK) {
        dK = this._selected[0];
        if (!dK) dK = this.ao
    };
    var An = dK;
    if (!direction) {
        if ((dK.bZ) && (this.sy(dK.bZ.d, "text", jU))) this.tK(dK);
        dK = this.ob(An);
        if (dK == -1) dK = this.ao.childNodes[0]
    } else {
        var z2 = this.pR(An);
        if (z2 == -1) z2 = this.qK(this.ao);
        if ((z2.bZ) && (this.sy(z2.bZ.d, "text", jU))) {
            this.tK(z2);
            dK = this.pR(An)
        } else dK = z2;
        if (dK == -1) dK = this.qK(this.ao)
    };
    while ((dK) && (dK != An)) {
        if ((dK.label) && (dK.label.search(jU) != -1)) return (dK);
        if (!direction) {
            if (dK == -1) {
                if (An == this.ao) break;
                dK = this.ao.childNodes[0]
            };
            if ((dK.bZ) && (this.sy(dK.bZ.d, "text", jU))) this.tK(dK);
            dK = this.ob(dK);
            if (dK == -1) dK = this.ao
        } else {
            var z2 = this.pR(dK);
            if (z2 == -1) z2 = this.qK(this.ao);
            if ((z2.bZ) && (this.sy(z2.bZ.d, "text", jU))) {
                this.tK(z2);
                dK = this.pR(dK)
            } else dK = z2;
            if (dK == -1) dK = this.qK(this.ao)
        }
    };
    return null
};
dhtmlXTreeObject.prototype.moveItem = function(itemId, mode, CN, qH) {
    var aX = this.ak(itemId);
    if (!aX) return (0);
    switch (mode) {
    case "right":
        alert('Not supported yet');
        break;
    case "item_child":
        var sl = (qH || this).ak(CN);
        if (!sl) return (0); (qH || this).fJ(aX, sl, 0);
        break;
    case "item_sibling":
        var sl = (qH || this).ak(CN);
        if (!sl) return (0); (qH || this).fJ(aX, sl.parentObject, sl);
        break;
    case "item_sibling_next":
        var sl = (qH || this).ak(CN);
        if (!sl) return (0);
        if ((sl.tr) && (sl.tr.nextSibling) && (sl.tr.nextSibling.mX))(qH || this).fJ(aX, sl.parentObject, sl.tr.nextSibling.mX);
        else(qH || this).fJ(aX, sl.parentObject);
        break;
    case "left":
        if (aX.parentObject.parentObject) this.fJ(aX, aX.parentObject.parentObject, aX.parentObject);
        break;
    case "up":
        var z = this.pR(aX);
        if ((z == -1) || (!z.parentObject)) return;
        this.fJ(aX, z.parentObject, z);
        break;
    case "up_strict":
        var z = this.SA(aX);
        if (z != 0) this.fJ(aX, aX.parentObject, aX.parentObject.childNodes[z - 1]);
        break;
    case "down_strict":
        var z = this.SA(aX);
        var count = aX.parentObject.aE - 2;
        if (z == count) this.fJ(aX, aX.parentObject);
        else if (z < count) this.fJ(aX, aX.parentObject, aX.parentObject.childNodes[z + 2]);
        break;
    case "down":
        var z = this.ob(this.qK(aX));
        if ((z == -1) || (!z.parentObject)) return;
        if (z.parentObject == aX.parentObject) var z = this.ob(z);
        if (z == -1) {
            this.fJ(aX, aX.parentObject)
        } else {
            if ((z == -1) || (!z.parentObject)) return;
            this.fJ(aX, z.parentObject, z)
        };
        break
    }
};
dhtmlXTreeObject.prototype.setDragBehavior = function(mode, select) {
    this.alG = (!K(select));
    switch (mode) {
    case "child":
        this.mj = 0;
        break;
    case "sibling":
        this.mj = 1;
        break;
    case "complex":
        this.mj = 2;
        break
    }
};
dhtmlXTreeObject.prototype.pA = function(id, src) {
    src = src || this.fs;
    var sn = (new Date()).valueOf();
    this.xA = id;
    if (this.Wa == "function") {
        if (src) src(this.xZ(id))
    } else if (this.Wa == "name") this.loadXML(src + this.xZ(id));
    else if (this.Wa == "xmlname") this.loadXML(src + this.xZ(id) + ".xml?uid=" + sn);
    else this.loadXML(src + jv(src) + "uid=" + sn + "&id=" + this.xZ(id))
};
dhtmlXTreeObject.prototype.enableMultiselection = function(mode, strict) {
    this.Wj = K(mode);
    this.aim = K(strict)
};
dhtmlXTreeObject.prototype.wb = function() {
    var ahv = new Array();
    for (var i = 0; i < this._selected.length; i++) for (var j = 0; j < this._selected.length; j++) if ((i != j) && (this.wj(this._selected[j], this._selected[i]))) ahv[ahv.length] = this._selected[j];
    for (var i = 0; i < ahv.length; i++) this.rH(ahv[i])
};
dhtmlXTreeObject.prototype.wj = function(abY, item2) {
    if (item2 == abY) return 1;
    if (abY.parentObject) return this.wj(abY.parentObject, item2);
    else return 0
};
dhtmlXTreeObject.prototype.enableDistributedParsing = function(mode, count, amY) {
    this.Lz = K(mode);
    this.hv = new Array();
    this.afa = count || 10;
    this.afv = amY || 250
};
dhtmlXTreeObject.prototype.getDistributedParsingState = function() {
    return (! ((!this.hv) || (!this.hv.length)))
};
dhtmlXTreeObject.prototype.getItemParsingState = function(itemId) {
    var z = this.ak(itemId, true, true);
    if (!z) return 0;
    if (this.hv) for (var i = 0; i < this.hv.length; i++) if (this.hv[i][2] == itemId) return - 1;
    return 1
};
dhtmlXTreeObject.prototype.LH = function(node, start, parentId, gR, ako) {
    if (!this.hv) this.hv = new Array();
    this.hv[this.hv.length] = [node, start, parentId, gR, ako]
};
dhtmlXTreeObject.prototype.NX = function(FC) {
    var self = this;
    if ((!this.hv) || (!this.hv.length)) {
        self.ek = 0;
        return
    };
    var z = this.hv[0];
    this.jy = new Array();
    this.Aq(z[0], z[2], z[3], z[1]);
    var aot = this.ak(z[2]);
    this.jm(this, aot, z[4], this.dD(aot));
    var wG = this.sK.split(this.jB);
    for (var n = 0; n < wG.length; n++) if (wG[n]) this.setCheck(wG[n], 1);
    this.hv = (new Array()).concat(this.hv.slice(1));
    if ((!this.hv.length)) {
        window.setTimeout(function() {
            if (self.onXLE) self.onXLE(self, FC);
            self.callEvent("onXLE", [self, FC])
        },
        1);
        self.ku = 0
    }
};
dhtmlXTreeObject.prototype.lL = function(mode, adZ) {
    this.adO = K(mode);
    this.Lo = adZ || 50
};
dhtmlXTreeObject.prototype.Og = function(node, pos, gR, Rq) {
    var z = document.createElement("DIV");
    z.innerHTML = "Previous " + this.Lo + " items";
    z.className = "dhx_next_button";
    var self = this;
    z.onclick = function() {
        self.Ur(this)
    };
    z.gH = [node, pos, gR, Rq];
    var w = node.childNodes[0];
    var w2 = w.span.parentNode.parentNode.parentNode.parentNode.parentNode;
    w2.insertBefore(z, w2.firstChild)
};
dhtmlXTreeObject.prototype.Od = function(node, pos, gR, Rq) {
    var z = document.createElement("DIV");
    z.innerHTML = "Next " + this.Lo + " items";
    z.className = "dhx_next_button";
    var self = this;
    z.onclick = function() {
        self.TW(this)
    };
    z.gH = [node, pos, gR, Rq];
    var w = node.childNodes[node.aE - 1];
    w.span.parentNode.parentNode.parentNode.parentNode.parentNode.appendChild(z)
};
dhtmlXTreeObject.prototype.TW = function(node) {
    tree.deleteChildItems(node.gH[0].id);
    node.parentNode.removeChild(node);
    var f = this.dD(node.gH[0]);
    this.hf(this, node.gH[3], node.gH[0].id, node.gH[2], null, node.gH[1]);
    this.jm(this, node.gH[0], 0);
    if (f > -1) this.nk(node.gH[0]);
    node.gH = null
};
dhtmlXTreeObject.prototype.Ur = function(node) {
    tree.deleteChildItems(node.gH[0].id);
    node.parentNode.removeChild(node);
    var f = this.dD(node.gH[0]);
    var xz = node.gH[1] - this.Lo;
    if (xz < 0) xz = 0;
    this.hf(this, node.gH[3], node.gH[0].id, node.gH[2], null, xz);
    this.jm(this, node.gH[0], 0);
    if (f > -1) this.nk(node.gH[0]);
    node.gH = null
};
dhtmlXTreeObject.prototype.enableTextSigns = function(mode) {
    this.Lu = K(mode)
};
dhtmlXTreeObject.prototype.vq = function(mode) {
    this.ir = K(mode);
    this.dF.hN = this.ir
};
dhtmlXTreeObject.prototype.jJ = dhtmlXTreeObject.prototype.vq;
dhtmlXTreeObject.prototype.disableCheckbox = function(itemId, mode) {
    if (typeof(itemId) != "object") var aX = this.ak(itemId, 0, 1);
    else var aX = itemId;
    if (!aX) return;
    aX.vO = K(mode) ? (((aX.cY || 0) % 3) + 3) : ((aX.cY > 2) ? (aX.cY - 3) : aX.cY);
    this.bL(aX);
    if (aX.vO < 3) aX.vO = false
};
dhtmlXTreeObject.prototype.adY = function(itemId, source) {
    this.ve = 1;
    this.smartRefreshItem(itemId, source)
};
dhtmlXTreeObject.prototype.smartRefreshItem = function(itemId, source) {
    var aX = this.ak(itemId);
    for (var i = 0; i < aX.aE; i++) aX.childNodes[i].acD = true;
    this.hL = true;
    if (source && source.exists) this.Aq(source, itemId);
    else this.pA(itemId, source)
};
dhtmlXTreeObject.prototype.WY = function(Ph, source) {
    var z = Ph.toString().split(this.jB);
    this.hL = new Array();
    for (var i = 0; i < z.length; i++) this.hL[z[i]] = true;
    this.loadXML((source || this.fs) + jv(source || this.fs) + "ids=" + this.xZ(Ph))
};
dhtmlXTreeObject.prototype.aak = function(itemId, name, im0, im1, im2, agV) {
    var aX = this.ak(itemId);
    aX.userData = new Fn();
    if (name) aX.label = name;
    aX.images = new Array(im0 || this.gZ[0], im1 || this.gZ[1], im2 || this.gZ[2]);
    this.setItemText(itemId, name);
    if (agV) this.bL(aX, true);
    this.cE(aX);
    aX.acD = false;
    return aX
};
dhtmlXTreeObject.prototype.setDropHandler = function(aQ) {
    this.attachEvent("onDrop", aQ)
};
dhtmlXTreeObject.prototype.eF = function(aQ) {
    this.attachEvent("onXLS", aQ)
};
dhtmlXTreeObject.prototype.dT = function(aQ) {
    this.attachEvent("onXLE", aQ)
};
dhtmlXTreeObject.prototype.setXMLAutoLoadingBehaviour = function(mode) {
    this.Wa = mode
};
dhtmlXTreeObject.prototype.enableSmartCheckboxes = function(mode) {
    this.xL = K(mode)
};
dhtmlXTreeObject.prototype.amy = function() {
    return (this.ku == 1)
};
dhtmlXTreeObject.prototype.setItemTopOffset = function(itemId, value) {
    if (typeof(itemId) == "string") var node = this.ak(itemId);
    else var node = itemId;
    var z = node.span.parentNode.parentNode;
    for (var i = 0; i < z.childNodes.length; i++) {
        if (i != 0) z.childNodes[i].style.height = 18 + parseInt(value) + "px";
        else {
            var w = z.childNodes[i].firstChild;
            if (z.childNodes[i].firstChild.tagName != 'DIV') {
                w = document.createElement("DIV");
                z.childNodes[i].insertBefore(w, z.childNodes[i].firstChild)
            };
            w.style.height = parseInt(value) + "px";
            if ((node.parentObject.id != this.fO || node.parentObject.childNodes[0] != node) && this.Fc) w.style.backgroundImage = "url(" + this.mF + this.wf[5] + ")";
            w.innerHTML = "&nbsp;";
            w.style.overflow = 'hidden';
            if (parseInt(value) == 0) z.childNodes[i].removeChild(w)
        };
        z.childNodes[i].vAlign = "bottom"
    }
};
dhtmlXTreeObject.prototype.yZ = function(Vc, SQ, itemId) {
    if (itemId) {
        if ((itemId) && (itemId.span)) var aX = itemId;
        else var aX = this.ak(itemId);
        if (!aX) return (0);
        var img = aX.span.parentNode.previousSibling.childNodes[0];
        if (Vc) {
            img.style.width = Vc;
            if (window._KHTMLrv) img.parentNode.style.width = Vc
        };
        if (SQ) {
            img.style.height = SQ;
            if (window._KHTMLrv) img.parentNode.style.height = SQ
        }
    } else {
        this.ST = Vc;
        this.SR = SQ
    }
};
dhtmlXTreeObject.prototype.getItemImage = function(itemId, agI, agb) {
    var node = this.ak(itemId);
    if (!node) return "";
    var img = node.images[agI || 0];
    if (agb) img = this.iconURL + img;
    return img
};
dhtmlXTreeObject.prototype.enableRadioButtons = function(itemId, mode) {
    if (arguments.length == 1) {
        this.Co = K(itemId);
        this.ps = this.ps || this.Co;
        return
    };
    var node = this.ak(itemId);
    if (!node) return "";
    mode = K(mode);
    if ((mode) && (!node.nN)) {
        node.nN = true;
        for (var i = 0; i < node.aE; i++) this.bL(node.childNodes[i], node.childNodes[i].cY)
    };
    if ((!mode) && (node.nN)) {
        node.nN = false;
        for (var i = 0; i < node.aE; i++) this.bL(node.childNodes[i], node.childNodes[i].cY)
    }
};
dhtmlXTreeObject.prototype.enableSingleRadioMode = function(mode) {
    this.aih = K(mode)
};
dhtmlXTreeObject.prototype.acK = function(mode) {
    this.agX = !K(mode)
};
dhtmlXTreeObject.prototype.openOnItemAdding = function(mode) {
    this.agX = !K(mode)
};
dhtmlXTreeObject.prototype.enableMultiLineItems = function(width) {
    if (width === true) this.Li = "100%";
    else this.Li = width
};
dhtmlXTreeObject.prototype.enableAutoTooltips = function(mode) {
    this.anL = K(mode)
};
dhtmlXTreeObject.prototype.pL = function(itemId) {
    if (itemId) this.rH(this.ak(itemId));
    else this.Fo()
};
dhtmlXTreeObject.prototype.showItemSign = function(itemId, state) {
    var AT = this.ak(itemId);
    if (!AT) return 0;
    var z = AT.span.parentNode.previousSibling.previousSibling.previousSibling;
    if (!K(state)) {
        this.nk(AT);
        AT.ro = false;
        AT.abd = true
    } else {
        AT.ro = true;
        AT.abd = false
    };
    this.cE(AT)
};
dhtmlXTreeObject.prototype.showItemCheckbox = function(itemId, state) {
    if (!itemId) for (var a in this.gQ) this.showItemCheckbox(this.gQ[a], state);
    if (typeof(itemId) != "object") itemId = this.ak(itemId, 0, 0);
    if (!itemId) return 0;
    itemId.BC = !K(state);
    var t = itemId.span.parentNode.previousSibling.previousSibling.childNodes[0];
    t.style.display = (!itemId.BC) ? "": "none";
    if (window._KHTMLrv) t.parentNode.style.display = (!itemId.BC) ? "": "none"
};
dhtmlXTreeObject.prototype.afn = function(separator) {
    this.jB = separator
};
dhtmlXTreeObject.prototype.ahW = function(mode) {
    this.aeh = mode
};
dhtmlXTreeObject.prototype.enableHighlighting = function(mode) {
    this.WG = true;
    this.aht = K(mode)
};
dhtmlXTreeObject.prototype.It = function() {
    var that = this.childNodes[3].parentObject;
    var tree = that.treeNod;
    tree.callEvent("onMouseOut", [that.id]);
    if (that.id == tree.NC) tree.NC = null;
    if (!tree.aht) return;
    that.span.className = that.span.className.replace("_lor", "")
};
dhtmlXTreeObject.prototype.Jf = function() {
    var that = this.childNodes[3].parentObject;
    var tree = that.treeNod;
    if (tree.NC != that.id) tree.callEvent("onMouseIn", [that.id]);
    tree.NC = that.id;
    if (!tree.aht) return;
    that.span.className = that.span.className.replace("_lor", "");
    that.span.className = that.span.className.replace(/((standart|selected)TreeRow)/, "$1_lor")
};
dhtmlXTreeObject.prototype.aey = function(mode) {
    this.Jm = K(mode)
};
dhtmlXTreeObject.prototype.focusItem = function(itemId) {
    var aX = this.ak(itemId);
    if (!aX) return (0);
    this.QH(aX)
};
dhtmlXTreeObject.prototype.Fx = function(itemId) {
    return this.DK(itemId)
};
dhtmlXTreeObject.prototype.Qp = function() {
    return this.oi(this.ao)
};
dhtmlXTreeObject.prototype.getAllLeafs = dhtmlXTreeObject.prototype.Qp;
dhtmlXTreeObject.prototype.oi = function(node) {
    var z = "";
    for (var i = 0; i < node.aE; i++) {
        if ((node.childNodes[i].bZ) || (node.childNodes[i].aE > 0)) {
            if (node.childNodes[i].bZ) var zb = this.uD(node.childNodes[i].bZ, 1);
            else var zb = this.oi(node.childNodes[i]);
            if (zb) if (z) z += this.jB + zb;
            else z = zb
        } else if (!z) z = node.childNodes[i].id;
        else z += this.jB + node.childNodes[i].id
    };
    return z
};
dhtmlXTreeObject.prototype.sj = function(node) {
    var z = "";
    for (var i = 0; i < node.aE; i++) {
        if ((node.childNodes[i].bZ) || (node.childNodes[i].aE > 0)) {
            if (!z) z = node.childNodes[i].id;
            else z += this.jB + node.childNodes[i].id;
            if (node.childNodes[i].bZ) var zb = this.zW(node.childNodes[i].bZ, 1);
            else var zb = this.sj(node.childNodes[i]);
            if (zb) z += this.jB + zb
        }
    };
    return z
};
dhtmlXTreeObject.prototype.IK = function() {
    return this.sj(this.ao)
};
dhtmlXTreeObject.prototype.getAllFatItems = dhtmlXTreeObject.prototype.IK;
dhtmlXTreeObject.prototype.getAllChecked = function() {
    return this.nB("", "", 1)
};
dhtmlXTreeObject.prototype.getAllUnchecked = function(itemId) {
    if (itemId) itemId = this.ak(itemId);
    return this.nB(itemId, "", 0)
};
dhtmlXTreeObject.prototype.getAllPartiallyChecked = function() {
    return this.nB("", "", 2)
};
dhtmlXTreeObject.prototype.getAllCheckedBranches = function() {
    var AT = this.nB("", "", 1);
    if (AT != "") AT += this.jB;
    return AT + this.nB("", "", 2)
};
dhtmlXTreeObject.prototype.nB = function(ao, list, mode) {
    if (!ao) ao = this.ao;
    if (ao.cY == mode) if (!ao.BC) {
        if (list) list += this.jB + ao.id;
        else list = ao.id
    };
    var j = ao.aE;
    for (var i = 0; i < j; i++) {
        list = this.nB(ao.childNodes[i], list, mode)
    };
    if (ao.bZ) list = this.LU(ao.bZ, list, mode);
    if (list) return list;
    else return ""
};
dhtmlXTreeObject.prototype.setItemStyle = function(itemId, Kv, resetCss) {
    var resetCss = resetCss || false;
    var AT = this.ak(itemId);
    if (!AT) return 0;
    if (!AT.span.style.cssText) AT.span.setAttribute("style", AT.span.getAttribute("style") + ";" + Kv);
    else AT.span.style.cssText = resetCss ? Kv: AT.span.style.cssText + ";" + Kv
};
dhtmlXTreeObject.prototype.enableImageDrag = function(mode) {
    this.Xy = K(mode)
};
dhtmlXTreeObject.prototype.setDragInHandler = function(aQ) {
    this.attachEvent("onDragIn", aQ)
};
dhtmlXTreeObject.prototype.enableDragAndDropScrolling = function(mode) {
    this.PZ = K(mode)
};
dhtmlXTreeObject.prototype.setSkin = function(name) {
    var YV = this.parentObject.className.replace(/dhxtree_[^ ]*/gi, "");
    this.parentObject.className = YV + " dhxtree_" + name
}; (function() {
    dhtmlx.extend_api("dhtmlXTreeObject", {
        ahY: function(obj) {
            return [obj.parent, (obj.width || "100%"), (obj.height || "100%"), (obj.root_id || 0)]
        },
        auto_save_selection: "enableAutoSavingSelected",
        auto_tooltip: "enableAutoTooltips",
        checkbox: "enableCheckBoxes",
        checkbox_3_state: "enableThreeStateCheckboxes",
        checkbox_smart: "enableSmartCheckboxes",
        context_menu: "enableContextMenu",
        distributed_parsing: "enableDistributedParsing",
        drag: "enableDragAndDrop",
        drag_copy: "enableMercyDrag",
        drag_image: "enableImageDrag",
        drag_scroll: "enableDragAndDropScrolling",
        editor: "enableItemEditor",
        hover: "enableHighlighting",
        images: "enableTreeImages",
        image_fix: "enableIEImageFix",
        image_path: "setImagePath",
        lines: "enableTreeLines",
        loading_item: "enableLoadingItem",
        multiline: "enableMultiLineItems",
        multiselect: "enableMultiselection",
        navigation: "enableKeyboardNavigation",
        radio: "enableRadioButtons",
        radio_single: "enableSingleRadioMode",
        rtl: "enableRTL",
        search: "enableKeySearch",
        smart_parsing: "enableSmartXMLParsing",
        smart_rendering: "enableSmartRendering",
        text_icons: "enableTextSigns",
        xml: "loadXML",
        skin: "setSkin"
    },
    {})
})();

/*
===================================================================
Copyright DHTMLX LTD. http://www.dhtmlx.com
This code is obfuscated and not allowed for any purposes except
using on sites which belongs to DHTMLX LTD.

Please contact sales@dhtmlx.com to obtain necessary
license for usage of dhtmlx components.

dhtmlxtree_dragin.js
===================================================================
*/
dhtmlXTreeObject.prototype.makeDraggable = function(obj, aQ) {
    if (typeof(obj) != "object") obj = document.getElementById(obj);
    M = new J();
    rR = new DC();
    M.dS(obj, rR);
    obj.aK = null;
    obj.ondragstart = rR.kY;
    obj.onselectstart = new Function("return false;");
    obj.parentObject = new Object;
    obj.parentObject.img = obj;
    obj.parentObject.treeNod = rR;
    rR.ME = aQ
};
dhtmlXTreeObject.prototype.wr = dhtmlXTreeObject.prototype.makeDraggable;
dhtmlXTreeObject.prototype.makeAllDraggable = function(aQ) {
    var z = document.getElementsByTagName("div");
    for (var i = 0; i < z.length; i++) if (z[i].getAttribute("dragInDhtmlXTree")) this.wr(z[i], aQ)
};
function DC() {
    this.Rs = window;
    this.gL = function(node) {
        var fj = document.createElement('div');
        fj.style.position = "absolute";
        fj.innerHTML = node.innerHTML;
        fj.style.zIndex = 12;
        return fj
    };
    this.kY = function(e) { (e || window.event).cancelBubble = true;
        if ((e) && (e.preventDefault)) {
            e.preventDefault();
            return false
        };
        return false
    };
    this.oy = function(tree, item, Eo, source) {
        if (this.ME) return this.ME(tree, source.img.id, item.id, Eo ? Eo.id: null);
        var image = (source.img.getAttribute("image") || "");
        var id = source.img.id || "new";
        var text = (source.img.getAttribute("text") || (_isIE ? source.img.innerText: source.img.textContent));
        tree[Eo ? "insertNewNext": "insertNewItem"](Eo ? Eo.id: item.id, id, text, "", image, image, image)
    }
};


/*
===================================================================
Copyright DHTMLX LTD. http://www.dhtmlx.com
This code is obfuscated and not allowed for any purposes except
using on sites which belongs to DHTMLX LTD.

Please contact sales@dhtmlx.com to obtain necessary
license for usage of dhtmlx components.

dhtmlxtree_xw.js
===================================================================
*/
dhtmlXTreeObject.prototype.nM = [["&", "&amp;"], ["<", "&lt;"], [">", "&gt;"]];
dhtmlXTreeObject.prototype.aeI = function(aho, ajv) {
    this.nM[this.nM.length] = [aho, ajv, new RegExp(aho, "g")]
};
dhtmlXTreeObject.prototype.setSerializationLevel = function(userData, QT, Sh, OY, arq) {
    this.GS = K(userData);
    this.JN = K(QT);
    this.aci = arq;
    this.Ck = K(Sh);
    if (K(OY)) {
        this.Ss = "<![CDATA[";
        this.St = "]]>"
    } else {};
    for (var i = 0; i < this.nM.length; i++) this.nM[i][2] = new RegExp(this.nM[i][0], "g")
};
dhtmlXTreeObject.prototype.serializeTree = function() {
    if (this.xS) this.xS();
    this.Ss = this.Ss || "";
    this.St = this.St || "";
    var out = '<?xml version="1.0"?>';
    if (this.aci) out += "<!DOCTYPE tree SYSTEM \"" + this.aci + "\">";
    out += '<tree id="' + this.fO + '">';
    if ((this.GS) && (this.gQ[this.fO].PJ)) {
        var uY = this.gQ[this.fO].PJ.split(",");
        for (var i = 0; i < uY.length; i++) out += "<userdata name=\"" + uY[i] + "\">" + this.Ss + this.gQ[this.fO].userData["t_" + uY[i]] + this.St + "</userdata>"
    };
    for (var i = 0; i < this.ao.aE; i++) out += this.pW(this.ao.childNodes[i]);
    out += "</tree>";
    return out
};
dhtmlXTreeObject.prototype.pW = function(at) {
    if (at.bZ) if (document.all) return at.bZ.d.xml;
    else {
        var kE = new XMLSerializer();
        return kE.serializeToString(at.bZ.d)
    };
    var out = "";
    if (this._selected.length) var Kq = this._selected[0].id;
    else Kq = "\"";
    var text = at.span.innerHTML;
    if (this.Ck) for (var i = 0; i < this.nM.length; i++) text = text.replace(this.nM[i][2], this.nM[i][1]);
    if (!this.JN) out = '<item id="' + at.id + '" ' + (this.dD(at) == 1 ? ' open="1" ': '') + (Kq == at.id ? ' select="1"': '') + ' text="' + text + '"' + (((this.fs) && (at.fS == 0)) ? " child=\"1\" ": "") + '>';
    else out = '<item id="' + at.id + '" ' + (this.dD(at) == 1 ? ' open="1" ': '') + (Kq == at.id ? ' select="1"': '') + ' text="' + text + '" im0="' + at.images[0] + '" im1="' + at.images[1] + '" im2="' + at.images[2] + '" ' + (at.kP ? ('aCol="' + at.kP + '" ') : '') + (at.mB ? ('sCol="' + at.mB + '" ') : '') + (at.cY == 1 ? 'checked="1" ': (at.cY == 2 ? 'checked="-1"': '')) + (at.closeable ? 'closeable="1" ': '') + '>';
    if ((this.GS) && (at.PJ)) {
        var uY = at.PJ.split(",");
        for (var i = 0; i < uY.length; i++) out += "<userdata name=\"" + uY[i] + "\">" + this.Ss + at.userData["t_" + uY[i]] + this.St + "</userdata>"
    };
    for (var i = 0; i < at.aE; i++) out += this.pW(at.childNodes[i]);
    out += "</item>";
    return out
};
dhtmlXTreeObject.prototype.Np = function(name, dZ) {
    name = name || "";
    this.jf("treeStateSelected" + name, this.getSelectedItemId(), dZ)
};
dhtmlXTreeObject.prototype.acq = function(name) {
    name = name || "";
    var z = this.lG("treeStateSelected" + name);
    this.selectItem(z, false)
};
dhtmlXTreeObject.prototype.enableAutoSavingSelected = function(mode, abZ) {
    this.Zy = K(mode);
    if ((this.Zy) && (!this.MF)) {
        this.MF = this.onRowSelect;
        this.onRowSelect = function(e, aI, mode) {
            if (!aI) aI = this;
            aI.parentObject.treeNod.MF(e, aI, mode);
            if (aI.parentObject.treeNod.Zy) aI.parentObject.treeNod.Np(aI.parentObject.treeNod.Us)
        }
    };
    this.Us = abZ
};
dhtmlXTreeObject.prototype.aoJ = function(name, dZ) {
    var z = this.xZ(this.serializeTree());
    var OZ = 4000;
    if (z.length > OZ) {
        if (navigator.appName.indexOf("Microsoft") != -1) return false;
        this.jf("treeStatex" + name, Math.ceil(z.length / OZ));
        for (var i = 0; i < Math.ceil(z.length / OZ); i++) {
            this.jf("treeStatex" + name + "x" + i, z.substr(i * OZ, OZ), dZ)
        }
    } else this.jf("treeStatex" + name, z, dZ);
    var z = this.lG("treeStatex" + name);
    if (!z) {
        this.jf("treeStatex" + name, "", dZ);
        return false
    };
    return true
};
dhtmlXTreeObject.prototype.aoN = function(name) {
    var z = this.lG("treeStatex" + name);
    if (!z) return false;
    if (z.length) {
        if (z.toString().length < 4) {
            var z2 = "";
            for (var i = 0; i < z; i++) {
                z2 += this.lG("treeStatex" + name + "x" + i)
            };
            z = z2
        };
        this.loadXMLString((this.aeh == "utf8") ? decodeURI(z) : unescape(z))
    };
    return true
};
dhtmlXTreeObject.prototype.jf = function(name, value, dZ) {
    var str = name + "=" + value + (dZ ? (";" + dZ) : "");
    document.cookie = str
};
dhtmlXTreeObject.prototype.lG = function(name) {
    var search = name + "=";
    if (document.cookie.length > 0) {
        var offset = document.cookie.indexOf(search);
        if (offset != -1) {
            offset += search.length;
            var end = document.cookie.indexOf(";", offset);
            if (end == -1) end = document.cookie.length;
            return document.cookie.substring(offset, end)
        }
    }
};
dhtmlXTreeObject.prototype.saveOpenStates = function(name, dZ) {
    var z = [];
    for (var i = 0; i < this.ao.aE; i++) z = z.concat(this.Ab(this.ao.childNodes[i]));
    z = z.join(this.jB);
    this.jf("treeOpenStatex" + name, z, dZ)
};
dhtmlXTreeObject.prototype.loadOpenStates = function(name) {
    for (var i = 0; i < this.ao.aE; i++) this.Ho(this.ao.childNodes[i]);
    this.cB.childNodes[0].border = "1";
    this.cB.childNodes[0].border = "0";
    var z = lG("treeOpenStatex" + name);
    if (z) {
        var arr = z.split(this.jB);
        for (var i = 0; i < arr.length; i++) {
            var UN = this.ak(arr[i]);
            if (UN) {
                if ((this.fs) && (!UN.fS) && (UN.id != this.fO)) {
                    this.Vg(UN, "loadOpenStates('" + name + "')");
                    return
                } else this.openItem(arr[i])
            }
        }
    };
    this.callEvent("onAllOpenDynamic", [])
};
dhtmlXTreeObject.prototype.Vg = function(node, name) {
    this.QK = name;
    this.rE = this.onXLE;
    this.onXLE = this.LM;
    this.loadXML(this.fs + jv(this.fs) + "id=" + this.xZ(node.id))
};
dhtmlXTreeObject.prototype.LM = function(tree) {
    tree.onXLE = tree.rE;
    window.setTimeout(function() {
        eval("tree." + tree.QK)
    },
    100);
    if (tree.onXLE) tree.onXLE(tree);
    tree.callEvent("onXLE", [tree])
};
dhtmlXTreeObject.prototype.Ab = function(node) {
    var list = [];
    if (this.dD(node) == 1) {
        list.push(node.id);
        for (var i = 0; i < node.aE; i++) list = list.concat(this.Ab(node.childNodes[i]))
    };
    return list
};
function jf(name, value) {
    document.cookie = name + '=' + value
};
function lG(name) {
    var search = name + "=";
    if (document.cookie.length > 0) {
        var offset = document.cookie.indexOf(search);
        if (offset != -1) {
            offset += search.length;
            var end = document.cookie.indexOf(";", offset);
            if (end == -1) end = document.cookie.length;
            return (document.cookie.substring(offset, end))
        }
    }
};
dhtmlXTreeObject.prototype.openAllItemsDynamic = function(itemId) {
    this.oN = new Array();
    this.oR = null;
    var at = this.ak(itemId || this.fO);
    if (at.id != this.fO && tree.KL(at.id) != 0) this.openItem(itemId);
    this.sV(at, 0);
    if (this.oN.length > 0) {
        this.rE = this.onXLE;
        this.onXLE = this.Jk;
        this.Jk(this)
    }
};
dhtmlXTreeObject.prototype.sV = function(at) {
    if ((at.fS == 0) || (at.bZ)) this.oN.push(at);
    for (var i = 0; i < at.aE; i++) {
        if (this.dD(at.childNodes[i]) < 0) this.kK(at.childNodes[i], 2);
        if (at.childNodes[i].aE > 0) this.sV(at.childNodes[i]);
        if ((at.childNodes[i].fS == 0) || (at.childNodes[i].bZ)) this.oN.push(at.childNodes[i])
    }
};
dhtmlXTreeObject.prototype.Jk = function(that) {
    if (that.oR) {
        that.nk(that.oR);
        that.sV(that.oR);
        that.oR = null
    };
    if (that.oN.length > 0) that.oR = that.oN.shift();
    if (that.oR) if (that.oR.bZ) that.tK(that.oR);
    else window.setTimeout(function() {
        that.pA(that.oR.id)
    },
    100);
    else {
        that.onXLE = that.rE;
        if (that.onXLE) that.onXLE(that);
        that.callEvent("onAllOpenDynamic", [that])
    }
};
dhtmlXTreeObject.prototype.NS = function(list, mt) {
    if (this.onXLE == this.JC) return;
    this.Zc = K(mt);
    this.rE = this.onXLE;
    this.onXLE = this.JC;
    this.oN = list.split(",").reverse();
    this.JC(this)
};
dhtmlXTreeObject.prototype.JC = function(that) {
    if (!that.oN.length) {
        that.onXLE = that.rE;
        if (that.Zc) that.selectItem(that.oR, true);
        if ((that.onXLE) && (arguments[1])) that.onXLE.apply(that, arguments);
        that.callEvent("onOpenDynamicEnd", []);
        return
    };
    that.oR = that.oN.pop();
    var AT = that.ak(that.oR);
    if (AT.fS === 0) that.openItem(that.oR);
    else {
        that.openItem(that.oR);
        that.JC(that)
    }
};

/*
===================================================================
Copyright DHTMLX LTD. http://www.dhtmlx.com
This code is obfuscated and not allowed for any purposes except
using on sites which belongs to DHTMLX LTD.

Please contact sales@dhtmlx.com to obtain necessary
license for usage of dhtmlx components.

dhtmlxtree_start.js
===================================================================
*/
function dhtmlXTreeFromHTML(obj) {
    if (typeof(obj) != "object") obj = document.getElementById(obj);
    var n = obj;
    var id = n.id;
    var vI = "";
    for (var j = 0; j < obj.childNodes.length; j++) if (obj.childNodes[j].nodeType == "1") {
        if (obj.childNodes[j].tagName == "XMP") {
            var ahm = obj.childNodes[j];
            for (var m = 0; m < ahm.childNodes.length; m++) vI += ahm.childNodes[m].data
        } else if (obj.childNodes[j].tagName.toLowerCase() == "ul") vI = Jx(obj.childNodes[j], new Array(), 0);
        break
    };
    obj.innerHTML = "";
    var t = new C(obj, "100%", "100%", 0);
    var ahw = new Array();
    for (b in t) ahw[b.toLowerCase()] = b;
    var atr = obj.attributes;
    for (var a = 0; a < atr.length; a++) if ((atr[a].name.indexOf("set") == 0) || (atr[a].name.indexOf("enable") == 0)) {
        var an = atr[a].name;
        if (!t[an]) an = ahw[atr[a].name];
        t[an].apply(t, atr[a].value.split(","))
    };
    if (typeof(vI) == "object") {
        t.ek = 1;
        for (var i = 0; i < vI.length; i++) {
            var n = t.insertNewItem(vI[i][0], vI[i][3], vI[i][1]);
            if (vI[i][2]) t.bL(n, vI[i][2])
        };
        t.ek = 0;
        t.wK = 0;
        t.jm(t)
    } else t.loadXMLString("<tree id='0'>" + vI + "</tree>");
    window[id] = t;
    return t
};
function Gw() {
    var z = document.getElementsByTagName("div");
    for (var i = 0; i < z.length; i++) if (z[i].className == "dhtmlxTree") dhtmlXTreeFromHTML(z[i])
};
function Jx(tag, data, ind) {
    for (var i = 0; i < tag.childNodes.length; i++) {
        var z = tag.childNodes[i];
        if ((z.nodeType == 1) && (z.tagName.toLowerCase() == "li")) {
            var c = "";
            var ul = null;
            var jC = z.getAttribute("checked");
            for (var j = 0; j < z.childNodes.length; j++) {
                var zc = z.childNodes[j];
                if (zc.nodeType == 3) c += zc.data;
                else if (zc.tagName.toLowerCase() != "ul") c += Sy(zc);
                else ul = zc
            };
            data[data.length] = [ind, c, jC, (z.id || (data.length + 1))];
            if (ul) data = Jx(ul, data, (z.id || data.length))
        }
    };
    return data
};
function Sy(node) {
    if (node.outerHTML) return node.outerHTML;
    var AT = document.createElement("DIV");
    AT.appendChild(node.cloneNode(true));
    AT = AT.innerHTML;
    return AT
};
if (window.addEventListener) window.addEventListener("load", Gw, false);
else if (window.attachEvent) window.attachEvent("onload", Gw);


/*
===================================================================
Copyright DHTMLX LTD. http://www.dhtmlx.com
This code is obfuscated and not allowed for any purposes except
using on sites which belongs to DHTMLX LTD.

Please contact sales@dhtmlx.com to obtain necessary
license for usage of dhtmlx components.

dhtmlxtree_json.js
===================================================================
*/
function eB(data, parent) {
    this.d = data;
    this.dp = parent
};
eB.prototype = {
    text: function() {
        var apn = function(n) {
            var p = [];
            for (var i = 0; i < n.length; i++) p.push("{" + afk(n[i]) + "}");
            return p.join(",")
        };
        var afk = function(n) {
            var p = [];
            for (var a in n) if (typeof(n[a]) == "object") {
                if (a.length) p.push('"' + a + '":[' + apn(n[a]) + "]");
                else p.push('"' + a + '":{' + afk(n[a]) + "}")
            } else p.push('"' + a + '":"' + n[a] + '"');
            return p.join(",")
        };
        return "{" + afk(this.d) + "}"
    },
    get: function(name) {
        return this.d[name]
    },
    exists: function() {
        return ! !this.d
    },
    content: function() {
        return this.d.content
    },
    Kw: function(name, f, t) {
        var a = this.d[name];
        var c = new eB();
        if (a) for (var i = 0; i < a.length; i++) {
            c.d = a[i];
            f.apply(t, [c, i])
        }
    },
    Zn: function() {
        return this.d
    },
    sub: function(name) {
        return new eB(this.d[name], this.d)
    },
    tX: function(name) {
        return ! !this.d[name]
    },
    aro: function(name, rule, f, t, i) {
        var a = this.d[name];
        var c = new eB(0, this.d);
        if (a) for (i = i || 0; i < a.length; i++) if (a[i][rule]) {
            c.d = a[i];
            if (f.apply(t, [c, i]) == -1) return
        }
    },
    up: function(name) {
        return new eB(this.dp, this.d)
    },
    set: function(name, val) {
        this.d[name] = val
    },
    QF: function(name) {
        return new eB(this.d, this.dp)
    },
    through: function(name, rule, v, f, t) {
        var a = this.d[name];
        if (a.length) for (var i = 0; i < a.length; i++) {
            if (a[i][rule] != null && a[i][rule] != "" && (!v || a[i][rule] == v)) {
                var c = new eB(a[i], this.d);
                f.apply(t, [c, i])
            };
            var w = this.d;
            this.d = a[i];
            if (this.tX(name)) this.through(name, rule, v, f, t);
            this.d = w
        }
    }
};
dhtmlXTreeObject.prototype.loadJSArrayFile = function(file, bo) {
    if (!this.lQ) this.callEvent("onXLS", [this, this.xA]);
    this.xA = null;
    this.ku = 1;
    var that = this;
    this.dF = new ag(function() {
        eval("var z=" + arguments[4].ai.responseText);
        that.loadJSArray(z)
    },
    this, true, this.ir);
    if (bo) this.dF.bs = bo;
    this.dF.loadXML(file)
};
dhtmlXTreeObject.prototype.loadCSV = function(file, bo) {
    if (!this.lQ) this.callEvent("onXLS", [this, this.xA]);
    this.xA = null;
    this.ku = 1;
    var that = this;
    this.dF = new ag(function() {
        that.loadCSVString(arguments[4].ai.responseText)
    },
    this, true, this.ir);
    if (bo) this.dF.bs = bo;
    this.dF.loadXML(file)
};
dhtmlXTreeObject.prototype.loadJSArray = function(ar, bo) {
    var z = [];
    for (var i = 0; i < ar.length; i++) {
        if (!z[ar[i][1]]) z[ar[i][1]] = [];
        z[ar[i][1]].push({
            id: ar[i][0],
            text: ar[i][2]
        })
    };
    var top = {
        id: this.fO
    };
    var f = function(top, f) {
        if (z[top.id]) {
            top.item = z[top.id];
            for (var j = 0; j < top.item.length; j++) f(top.item[j], f)
        }
    };
    f(top, f);
    this.loadJSONObject(top, bo)
};
dhtmlXTreeObject.prototype.loadCSVString = function(csv, bo) {
    var z = [];
    var ar = csv.split("\n");
    for (var i = 0; i < ar.length; i++) {
        var t = ar[i].split(",");
        if (!z[t[1]]) z[t[1]] = [];
        z[t[1]].push({
            id: t[0],
            text: t[2]
        })
    };
    var top = {
        id: this.fO
    };
    var f = function(top, f) {
        if (z[top.id]) {
            top.item = z[top.id];
            for (var j = 0; j < top.item.length; j++) f(top.item[j], f)
        }
    };
    f(top, f);
    this.loadJSONObject(top, bo)
};
dhtmlXTreeObject.prototype.loadJSONObject = function(json, bo) {
    if (!this.lQ) this.callEvent("onXLS", [this, null]);
    this.ku = 1;
    var p = new eB(json);
    this.Aq(p);
    this.Pv = p;
    if (bo) bo()
};
dhtmlXTreeObject.prototype.loadJSON = function(file, bo) {
    if (!this.lQ) this.callEvent("onXLS", [this, this.xA]);
    this.xA = null;
    this.ku = 1;
    var that = this;
    this.dF = new ag(function() {
        try {
            eval("var t=" + arguments[4].ai.responseText)
        } catch(e) {
            ey.gn("LoadXML", "Incorrect JSON", [(arguments[4].ai), this]);
            return
        };
        var p = new eB(t);
        that.Aq(p);
        that.Pv = p
    },
    this, true, this.ir);
    if (bo) this.dF.bs = bo;
    this.dF.loadXML(file)
};
dhtmlXTreeObject.prototype.acw = function() {
    var out = ['{"id":"' + this.fO + '", "item":['];
    var p = [];
    for (var i = 0; i < this.ao.aE; i++) p.push(this.zy(this.ao.childNodes[i]));
    out.push(p.join(","));
    out.push("]}");
    return out.join("")
};
dhtmlXTreeObject.prototype.zy = function(at) {
    var out = [];
    if (at.bZ) return (at.bZ.text());
    if (this._selected.length) var Kq = this._selected[0].id;
    else Kq = "";
    var text = at.span.innerHTML;
    if (this.Ck) for (var i = 0; i < this.nM.length; i++) text = text.replace(this.nM[i][2], this.nM[i][1]);
    if (!this.JN) out.push('{"id":"' + at.id + '", ' + (this.dD(at) == 1 ? ' "open":"1", ': '') + (Kq == at.id ? ' "select":"1",': '') + ' "text":"' + text + '"' + (((this.fs) && (at.fS == 0)) ? ', "child":"1" ': ''));
    else out.push('{"id":"' + at.id + '", ' + (this.dD(at) == 1 ? ' "open":"1", ': '') + (Kq == at.id ? ' "select":"1",': '') + ' "text":"' + text + '", "im0":"' + at.images[0] + '", "im1":"' + at.images[1] + '", "im2":"' + at.images[2] + '" ' + (at.kP ? (', "aCol":"' + at.kP + '" ') : '') + (at.mB ? (', "sCol":"' + at.mB + '" ') : '') + (at.cY == 1 ? ', "checked":"1" ': (at.cY == 2 ? ', "checked":"-1"': '')) + (at.closeable ? ', "closeable":"1" ': ''));
    if ((this.GS) && (at.PJ)) {
        out.push(', "userdata":[');
        var uY = at.PJ.split(",");
        var p = [];
        for (var i = 0; i < uY.length; i++) p.push('{"name":"' + uY[i] + '" , "content":"' + at.userData["t_" + uY[i]] + '" }');
        out.push(p.join(","));
        out.push("]")
    };
    if (at.aE) {
        out.push(', "item":[');
        var p = [];
        for (var i = 0; i < at.aE; i++) p.push(this.zy(at.childNodes[i]));
        out.push(p.join(","));
        out.push("]\n")
    };
    out.push("}\n");
    return out.join("")
};


/*
===================================================================
Copyright DHTMLX LTD. http://www.dhtmlx.com
This code is obfuscated and not allowed for any purposes except
using on sites which belongs to DHTMLX LTD.

Please contact sales@dhtmlx.com to obtain necessary
license for usage of dhtmlx components.

dhtmlxtree_li.js
===================================================================
*/
dhtmlXTreeObject.prototype.isLocked = function(itemId) {
    if (!this.nG) this.Hp();
    return (this.nG[itemId] == true)
};
dhtmlXTreeObject.prototype.Te = function(aX, state, agD) {
    if (!this.nG) this.Hp();
    if (state) {
        if (this.nG[aX.id] == true) return;
        this.nG[aX.id] = true;
        aX.apm = aX.images[0];
        aX.apq = aX.images[1];
        aX.hO = aX.images[2];
        aX.images[0] = this.aof;
        aX.images[1] = this.aog;
        aX.images[2] = this.aok;
        var z1 = aX.span.parentNode;
        var z2 = z1.previousSibling;
        this.M.fG(z1);
        this.M.fG(z2)
    } else {
        if (this.nG[aX.id] != true) return;
        this.nG[aX.id] = false;
        aX.images[0] = aX.apm;
        aX.images[1] = aX.apq;
        aX.images[2] = aX.hO;
        var z1 = aX.span.parentNode;
        var z2 = z1.previousSibling;
        this.M.dS(z1, this);
        this.M.dS(z2, this)
    };
    if (!agD) this.cE(aX)
};
dhtmlXTreeObject.prototype.GY = function(itemId, state) {
    if (!this.nG) this.Hp();
    this.RS = false;
    var aX = this.ak(itemId);
    this.RS = true;
    this.Te(aX, K(state))
};
dhtmlXTreeObject.prototype.setLockedIcons = function(im0, im1, im2) {
    if (!this.nG) this.Hp();
    this.aof = im0;
    this.aog = im1;
    this.aok = im2
};
dhtmlXTreeObject.prototype.Hp = function() {
    this.nG = new Array();
    this.akb = "0";
    this.RS = true;
    this.Fj = this.ak;
    this.ak = this.XY;
    if (this.pW) {
        this.Pn = this.pW;
        this.pW = this.Kx;
        this.Ps = this.serializeTree;
        this.serializeTree = this.KE
    };
    this.setLockedIcons(this.gZ[0], this.gZ[1], this.gZ[2])
};
dhtmlXTreeObject.prototype.XY = function(itemId, AE, pd) {
    if (!this.Xf) if ((!pd) && (this.RS == true) && (this.nG[itemId] == true)) {
        return null
    };
    return this.Fj(itemId, AE, pd)
};
dhtmlXTreeObject.prototype.Kx = function(node) {
    if (this.nG[node.id] == true) return "";
    return this.Pn(node)
};
dhtmlXTreeObject.prototype.KE = function() {
    var out = this.Ps();
    return out.replace(/<item[^>]+locked\=\"1\"[^>]+\/>/g, "")
};
dhtmlXTreeObject.prototype.Xi = dhtmlXTreeObject.prototype.fJ;
dhtmlXTreeObject.prototype.fJ = function(aa, bn, bT) {
    if ((bn.treeNod.isLocked) && (bn.treeNod.isLocked(bn.id))) {
        return false
    };
    return this.Xi(aa, bn, bT)
};
dhtmlXTreeObject.prototype.XB = function(adw) {
    if (K(adw)) this.YU();
    else if (this.uC) {
        this.uC.parentNode.removeChild(this.uC);
        this.uC = null
    }
};
dhtmlXTreeObject.prototype.YU = function(adw) {
    if (this.uC) return;
    this.parentObject.style.overflow = "hidden";
    if (this.parentObject.style.position != 'absolute') this.parentObject.style.position = 'relative';
    var div = document.createElement('div');
    div.style.position = 'absolute';
    div.style.left = '0px';
    div.style.top = '0px';
    div.className = 'dhx_tree_opacity';
    div.style.width = this.cB.offsetWidth + 'px';
    div.style.backgroundColor = '#FFFFFF';
    div.style.height = this.cB.offsetHeight + 'px';
    this.uC = div;
    this.parentObject.appendChild(this.uC)
};

/*
===================================================================
Copyright DHTMLX LTD. http://www.dhtmlx.com
This code is obfuscated and not allowed for any purposes except
using on sites which belongs to DHTMLX LTD.

Please contact sales@dhtmlx.com to obtain necessary
license for usage of dhtmlx components.

dhtmlxtree_kn.js
===================================================================
*/
dhtmlXTreeObject.prototype.enableKeyboardNavigation = function(mode) {
    this.Tf = K(mode);
    if (this.Tf) {
        if (aq) {
            var z = window.getComputedStyle(this.parentObject, null)["position"];
            if ((z != "absolute") && (z != "relative")) this.parentObject.style.position = "relative"
        };
        this.GV = [["up", 38], ["down", 40], ["open", 39], ["close", 37], ["call", 13], ["edit", 113]];
        var self = this;
        var z = document.createElement("INPUT");
        z.className = "a_dhx_hidden_input";
        z.autocomplete = "off";
        if (window._KHTMLrv) z.style.color = "white";
        this.parentObject.appendChild(z);
        this.parentObject.onkeydown = function(e) {
            if (self.callEvent("onKeyPress", [(e || window.event).keyCode, (e || window.event)])) return self._onKeyDown(e || window.event)
        };
        this.parentObject.onclick = function(e) {
            if (aq) z.select();
            if (window._KHTMLrv || cU) z.focus()
        }
    } else this.parentObject.onkeydown = null
};
dhtmlXTreeObject.prototype._onKeyDown = function(e) {
    var self = this;
    for (var i = 0; i < this.GV.length; i++) if (this.GV[i][1] == e.keyCode) {
        this["_onkey_" + this.GV[i][0]].apply(this, [this.getSelectedItemId()]);
        if (e.preventDefault) e.preventDefault(); (e || event).cancelBubble = true;
        return false
    };
    if (this.Mv) {
        return this.Ni(e)
    };
    return true
};
dhtmlXTreeObject.prototype._onkey_up = function(id) {
    var AT = this.ak(id);
    if (!AT) return;
    var next = this.IO(AT);
    if (next.id == this.fO) return;
    this.focusItem(next.id);
    this.selectItem(next.id, false)
};
dhtmlXTreeObject.prototype._onkey_down = function(id) {
    var AT = this.ak(id);
    if (!AT) return;
    var next = this.xH(AT);
    if (next.id == this.fO) return;
    this.focusItem(next.id);
    this.selectItem(next.id, false)
};
dhtmlXTreeObject.prototype._onkey_open = function(id) {
    this.openItem(id)
};
dhtmlXTreeObject.prototype._onkey_close = function(id) {
    this.closeItem(id)
};
dhtmlXTreeObject.prototype._onkey_call = function(id) {
    if (this.xS) {
        this.xS();
        this.parentObject.lastChild.focus();
        this.parentObject.lastChild.focus();
        this.selectItem(id, true)
    } else this.selectItem(this.getSelectedItemId(), true)
};
dhtmlXTreeObject.prototype._onkey_edit = function(id) {
    if (this.WH) this.WH(id)
};
dhtmlXTreeObject.prototype.xH = function(item, mode) {
    if ((!mode) && (this.dD(item) > 0)) return item.childNodes[0];
    if ((item.tr) && (item.tr.nextSibling) && (item.tr.nextSibling.mX)) return item.tr.nextSibling.mX;
    if (item.parentObject) return this.xH(item.parentObject, 1);
    return item
};
dhtmlXTreeObject.prototype.IO = function(item) {
    if ((item.tr) && (item.tr.previousSibling) && (item.tr.previousSibling.mX)) return this.Bd(item.tr.previousSibling.mX);
    if (item.parentObject) return item.parentObject;
    else return item
};
dhtmlXTreeObject.prototype.Bd = function(item) {
    if (this.dD(item) > 0) return this.Bd(item.childNodes[item.aE - 1]);
    else return item
};
dhtmlXTreeObject.prototype.Ni = function(e) {
    if (e.keyCode == 8) {
        this.pG = '';
        return true
    };
    var Gb = String.fromCharCode(e.keyCode).toUpperCase();
    if (Gb.match(/[A-Z,a-z,0-9\ ]/)) {
        this.pG += Gb;
        this.pV = true;
        if (! (this.xB() || "").match(RegExp('^' + this.pG, "i"))) {
            this.findItem('^' + this.pG, 0)
        };
        this.pV = false;
        if (e.preventDefault) e.preventDefault(); (e || event).cancelBubble = true;
        return false
    };
    return true
};
dhtmlXTreeObject.prototype.assignKeys = function(kk) {
    this.GV = kk
};
dhtmlXTreeObject.prototype.enableKeySearch = function(mode) {
    this.Mv = K(mode);
    if (!this.Mv) return;
    this.pG = '';
    var self = this;
    this.ZS = this.qy;
    this.qy = function(node) {
        if (!self.pV) self.pG = '';
        self.ZS(node)
    }
};



/*
===================================================================
Copyright DHTMLX LTD. http://www.dhtmlx.com
This code is obfuscated and not allowed for any purposes except
using on sites which belongs to DHTMLX LTD.

Please contact sales@dhtmlx.com to obtain necessary
license for usage of dhtmlx components.

dhtmlxtree_ed.js
=================================================================== 
*/
dhtmlXTreeObject.prototype.enableItemEditor = function(mode) {
    this.ale = K(mode);
    if (!this.ZP) {
        this.Ia = true;
        this.HY = true;
        this.aos = this.asf;
        this.XG = this.aco;
        this.mY(function(a, b) {
            if (this.HY) this.KB(a, b);
            return true
        });
        this.ck(function(a, b) {
            this.TT(a, b);
            if ((this.Uh == a) && (this.Ia)) this.KB(a, b);
            this.Uh = a;
            return true
        });
        this.ZP = true
    }
};
dhtmlXTreeObject.prototype.setOnEditHandler = function(aQ) {
    this.attachEvent("onEdit", aQ)
};
dhtmlXTreeObject.prototype.setEditStartAction = function(afV, dblclick) {
    this.Ia = K(afV);
    this.HY = K(dblclick)
};
dhtmlXTreeObject.prototype.zo = function(a) {
    if (this.gp) {
        this.ko = this.Wo;
        if (this.gp.id != a) {
            var mu = true;
            mu = this.callEvent("onEdit", [2, this.gp.id, this, this.gp.span.childNodes[0].value]);
            if (mu === true) mu = this.gp.span.childNodes[0].value;
            else if (mu === false) mu = this.gp.Tp;
            var changed = (mu != this.gp.Tp);
            this.gp.span.innerHTML = mu;
            this.gp.label = this.gp.span.innerHTML;
            var arA = this.gp.tA ? "selectedTreeRow": "standartTreeRow";
            this.gp.span.className = arA;
            this.gp.span.parentNode.className = "standartTreeRow";
            this.gp.span.style.paddingRight = this.gp.span.style.paddingLeft = '5px';
            this.gp.span.onclick = function() {};
            var id = this.gp.id;
            if (this.fo) this.fH(this.gp);
            this.gp = null;
            this.callEvent("onEdit", [3, id, this, changed]);
            if (this.Tf) {
                this.parentObject.lastChild.focus();
                this.parentObject.lastChild.focus()
            }
        }
    }
};
dhtmlXTreeObject.prototype.TT = function(id, tree) {
    this.zo(id)
};
dhtmlXTreeObject.prototype.xS = function() {
    if (this.gp) this.zo(this.gp.id + "_non")
};
dhtmlXTreeObject.prototype.WH = function(id) {
    this.KB(id, this)
};
dhtmlXTreeObject.prototype.KB = function(id, tree) {
    if (this.ale) {
        this.zo();
        var AT = this.ak(id);
        if (!AT) return;
        mu = this.callEvent("onEdit", [0, id, this, AT.span.innerHTML]);
        if (mu === true) mu = AT.label;
        else if (mu === false) return;
        this.Wo = this.ko;
        this.ko = false;
        this.gp = AT;
        AT.Tp = mu;
        AT.span.innerHTML = "<input type='text' class='intreeeditRow' />";
        AT.span.style.paddingRight = AT.span.style.paddingLeft = '0px';
        AT.span.childNodes[0].value = mu;
        AT.span.childNodes[0].onselectstart = function(e) { (e || event).cancelBubble = true;
            return true
        };
        AT.span.childNodes[0].onmousedown = function(e) { (e || event).cancelBubble = true;
            return true
        };
        AT.span.childNodes[0].focus();
        AT.span.childNodes[0].focus();
        AT.span.onclick = function(e) { (e || event).cancelBubble = true;
            return false
        };
        AT.span.className = "";
        AT.span.parentNode.className = "";
        var self = this;
        AT.span.childNodes[0].onkeydown = function(e) {
            if (!e) e = window.event;
            if (e.keyCode == 13) {
                e.cancelBubble = true;
                self.zo( - 1)
            } else if (e.keyCode == 27) {
                self.gp.span.childNodes[0].value = self.gp.Tp;
                self.zo( - 1)
            }; (e || event).cancelBubble = true
        };
        this.callEvent("onEdit", [1, id, this])
    }
};

/*
===================================================================
Copyright DHTMLX LTD. http://www.dhtmlx.com
This code is obfuscated and not allowed for any purposes except
using on sites which belongs to DHTMLX LTD.

Please contact sales@dhtmlx.com to obtain necessary
license for usage of dhtmlx components.
===================================================================
*/
dhtmlXTreeObject.prototype.enableSmartRendering=function(){this.enableSmartXMLParsing(true);this.ahK=true;this.rj=18;var that=this;this.cB.onscroll=function(){if(that.aeA)return;that.aeA=window.setTimeout(function(){that.aeA=null;that.CI()},300)};this.attachEvent("onXLE",function(){that.CI()});this.WC()};dhtmlXTreeObject.prototype.CI=function(){if(!this.gQ[this.fO].Rb)this.zz(this.fO,true);var top=this.cB.scrollTop;var pos=Math.floor(top/this.rj);var height=Math.ceil(this.cB.offsetHeight/this.rj);this.TO=true;this.Ih(top,this.rj,height,null,false,this.DY);this.TO=false};dhtmlXTreeObject.prototype.DY=function(a,b){if(!a.span){a.span= -1;var z=a.parentObject.ao.childNodes[0].childNodes;var count=b*this.rj;var x=null;for(var i=1;i<z.length;i++){x=z[i];var y=x.mX?this.rj:(x.offsetHeight||parseInt(x.childNodes[1].firstChild.style.height));count-=y;if(count<0){if(count== -1){count++;continue};var h=x.childNodes[1].firstChild;h.style.height=(parseInt(h.style.height)-(y-Math.abs(count)+this.rj))+"px";if(Math.abs(count)!=y){var fill=this.FP(count+y,true);x.parentNode.insertBefore(fill,x)};x.tr={nextSibling:x};break}};if(h&&h.style.height!="0px"&& !x.offsetHeight){var rh=this.agX;this.agX=true};this.OU(a.anr,a.parentObject,null,x);if(h&&h.style.height!="0px"&& !x.offsetHeight){this.agX=rh};if(a.bZ)this.cE(a);if(h&&h.style.height=="0px")x.parentNode.removeChild(x)}};dhtmlXTreeObject.prototype.aaQ=function(z,pd){if(z.parentObject)this.ak(z.parentObject.id);if(!this.gQ[this.fO].Rb)this.zz(this.fO,true);this.DY(z,this.SA(z));if((z.bZ)&&(!pd))this.tK(z,0);if(!z.zz)this.zz(z.id)};dhtmlXTreeObject.prototype.SA=function(z){for(var a=0;a<z.parentObject.aE;a++)if(z.parentObject.childNodes[a]==z)return a};dhtmlXTreeObject.prototype.zz=function(it,mode){it=this.gQ[it];if(it.Rb)return;var tr=this.FP(this.rj*it.aE,mode);it.ao.childNodes[0].appendChild(tr);it.Rb=true};dhtmlXTreeObject.prototype.FP=function(s,mode){var t=document.createElement("TR");var b=document.createElement("TD");var b2=document.createElement("TD");var z=document.createElement("DIV");z.innerHTML="&nbsp;";b.appendChild(z);t.appendChild(b2);t.appendChild(b);if(!mode){t.style.display="none"};z.style.height=s+'px';return t};dhtmlXTreeObject.prototype.aiV=function(item,mode){if((!mode)&&(item.aE))return item.childNodes[0];if(item==this.ao)return-1;if((item.tr)&&(item.tr.nextSibling)&&(item.tr.nextSibling.mX))return item.tr.nextSibling.mX;return this.ob(item.parentObject,true)};dhtmlXTreeObject.prototype.Ih=function(pos,h,l,i,m,f){if(!i){this.aef=pos;i=this.gQ[this.fO]};for(var j=0;j<i.aE;j++){this.aef-=h;if(this.aef<=0)m=true;if(m){f.apply(this,[i.childNodes[j],j]);l--};if(l<0)return l;if(i.childNodes[j].ahl){l=this.Ih(null,h,l,i.childNodes[j],m,f);if(l<0)return l}};return l};dhtmlXTreeObject.prototype.WE=function(qc,id,p){var parentObject=this.gQ[qc];var Count=parentObject.aE;var dN=parentObject.childNodes;dN[Count]=new dhtmlXTreeItemObject(id,"",parentObject,this,null,1);itemId=dN[Count].id;dN[Count].anr=p.QF();parentObject.aE++};dhtmlXTreeObject.prototype.WC=function(){this.jm=function(){};var Yr=dhtmlXTreeItemObject;this.WC=function(){};window.dhtmlXTreeItemObject=function(itemId,itemText,parentObject,bG,eP,mode){if(!bG.ahK){return Yr.call(this,itemId,itemText,parentObject,bG,eP,mode)};this.ao="";this.kP="";this.mB="";this.tr=0;this.aE=0;this.dH=0;this.dG=0;this.fj=0;this.MP=0;this.span=0;this.ro=1;this.childNodes=new Array();this.userData=new Fn();this.cY=0;this.treeNod=bG;this.label=itemText;this.parentObject=parentObject;this.eP=eP;this.images=new Array(bG.gZ[0],bG.gZ[1],bG.gZ[2]);this.id=bG.oh(itemId,this);if(itemId==bG.fO){if(this.treeNod.ps)this.ao=this.treeNod.ux(1,this,mode);else this.ao=this.treeNod.ux(0,this,mode);this.ao.Jh=this};return this};this.setCheckSR=this.mA;this.mA=function(itemId,state){this.ak(itemId);return this.setCheckSR(itemId,state)};this.aif=function(id){var p=[];while(id!=this.fO){var qc=this.getParentId(id);for(var i=0;i<this.gQ[qc].aE;i++)if(this.gQ[qc].childNodes[i].id==id){p.push([qc,i]);break};id=qc};p.reverse();return p};this.agU=function(id,p,mask){p=p||[];var pos=0;while(true){var i=this.gQ[id];if(i.anr&&this.sy(i.anr.d,"text",mask))this.ak(i.id);var pos=i.aE;if(!pos)break;p.push([id,pos-1]);id=i.childNodes[pos-1].id};return p};this.agz=function(p,mask){if(!p.length)p.push.apply(p,this.agU(0,null,mask));var last=p[p.length-1];if(last[1]){last[1]--;var curr=this.gQ[last[0]].childNodes[last[1]];this.agU(curr.id,p,mask);var last=p[p.length-1];return this.gQ[last[0]].childNodes[last[1]]}else{p.pop();if(!p.length)return this.agz(p,mask);var last=p[p.length-1];return this.gQ[last[0]].childNodes[last[1]]}};this.agB=function(p,Ch){if(!p.length)p.push([this.fO,0]);var last=p[p.length-1];var curr=this.gQ[last[0]].childNodes[last[1]];if(curr.aE&& !Ch){p.push([curr.id,0]);return curr.childNodes[0]};last[1]++;var curr=this.gQ[last[0]].childNodes[last[1]];if(curr)return curr;p.pop();if(!p.length)return this.ao;return this.agB(p,true)};this.Cj=function(jU,direction,dK){var jU=jU.replace(new RegExp("^( )+"),"").replace(new RegExp("( )+$"),"");jU=new RegExp(jU.replace(/([\*\+\\\[\]\(\)]{1})/gi,"\\$1").replace(/ /gi,".*"),"gi");if(!dK){dK=this._selected[0];if(!dK)dK=this.ao};var An=dK;var p=this.aif(An.id);while(dK=(direction?this.agz(p,jU):this.agB(p))){if(dK.label){if(dK.label.search(jU)!= -1)return dK}else{if(dK.anr){if(dK.anr.get("text").search(jU)!= -1)return dK;if(this.sy(dK.anr.d,"text",jU))this.ak(dK.id)}};if((dK.bZ)&&(this.sy(dK.bZ.d,"text",jU)))this.tK(dK);if(An==dK)break};return null};this.fa=function(id){if(this.fO==id){this._selected=new Array();this.gQ={};this.Pv=this.aef=this.SV=null;this.cB.removeChild(this.ao.ao);this.ao=new dhtmlXTreeItemObject(this.fO,"",0,this);this.ao.ao.childNodes[0].childNodes[0].style.display="none";this.ao.ao.childNodes[0].childNodes[0].childNodes[0].className="hiddenRow";this.cB.insertBefore(this.ao.ao,this.selectionBar);if(aq){this.cB.childNodes[0].width="100%";this.cB.childNodes[0].style.overflow="hidden"}}};this.kK=function(aa,mode){if((this.fs)&&(!aa.fS)){if(mode==1)return;aa.fS=1;this.pA(aa.id);return};if(!aa.span)this.aaQ(aa);if(aa.bZ){this.tK(aa);this.zz(aa.id)};if(aa.aE==0)return;var dN=aa.ao.childNodes[0].childNodes;var Count=dN.length;if(Count>1){if(((dN[1].style.display!="none")||(mode==1))&&(mode!=2)){this.cB.childNodes[0].border="1";this.cB.childNodes[0].border="0";var zJ="none";aa.ahl=false}else{var zJ="";aa.ahl=true};for(var i=1;i<Count;i++)dN[i].style.display=zJ;this.CI()};this.cE(aa)}};
